2
BindingSource source = new BindingSource();
source.Add(new List<string>() { "1", "2", "3" });
//List<string> theList = source.List;//compile fail. Can't convert from IList to List<T> implicity
List<string> theList = source.List as List<string>;//fail, null
我見過有人在線創建一個方法來執行顯式轉換。這似乎對於這項任務來說是完全矯枉過正的。有沒有更好的方法讓我的名單回來?如何將IList轉換回BindingSource中的列表<T>?