How can I cast an IList<Customer>
list to BindingList<Customer>
?
Convert IList<T> to BindingList<T>
var yourList = new List<Customer>();
var listBinding = new BindingList<Customer>(yourList);
You don't need to do a cast, just provide the BindingList<T>
class constructor with IList<T>
, which you have.
Since there is no ToBindingList() method with LINQ, can you answer the question for those cases? something like this: BindingList<cRecord> cr = cRecords.Take(TotalDays).ToList(); –
Melanochroi
© 2022 - 2024 — McMap. All rights reserved.