comboBoxPlanResult.DataSource =new BindingSource(o,null);
comboBoxPlanResult.DisplayMember ="Key";
comboBoxPlanResult.ValueMember ="Value";
DataGridView 类,ListBox等控件支持标准的 Windows 窗体数据绑定模型。这意味着数据源可以是实现下列接口之一的任何类型:
IList 接口,包括一维数组,ArrayList也是。
IListSource 接口,例如,DataTable 和 DataSet 类。
IBindingList 接口,例如,BindingList 类。
IBindingListView 接口,例如,BindingSource 类。
如果把其它的东西当做数据源,就会出现上面的错误。
本文深入探讨了Windows窗体中数据绑定的概念,重点介绍了如何将数据源应用于DataGridView、ListBox等控件,并通过示例代码展示了具体实现过程。
2195

被折叠的 条评论
为什么被折叠?



