2012-04-18 62 views

回答

12

试试这个

List<int> list = yourBindingList.ToList(); 

int是你喜欢的类型=)

+0

我没有看到ToList()或Cast()方法与我的BindingList或MSDN中。这是一个不同的BindingList比System.ComponentModel.BindingList ? – 2014-11-09 01:26:18

+2

@RichShealer - 有点晚,但你需要确保你添加使用System.Linq; ToList()是一个扩展方法。 – CathalMF 2015-06-16 12:26:52

2

名单列表= yourBindingList.Cast()ToList()。

1

如果您使用.NET 2.0,那么这是解决方案:

public List<T> ToList() 
{ 
    return new List<T>(this); // this - is a BindingList compatible object 
} 
相关问题