How can I cast an IList<Customer> list to BindingList<Customer>?

有帮助吗?

解决方案

var yourList = new List<Customer>();
var listBinding = new BindingList<Customer>(yourList);

BindingList Constructors

You don't need to do a cast, just provide the BindingList<T> class constructor with IList<T>, which you have.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top