现在的位置: 首页 > 综合 > 正文

.NET 复杂的 DataBinding 接受 IList 或 IListSource 作为数据源

2012年08月20日 ⁄ 综合 ⁄ 共 266字 ⁄ 字号 评论关闭

问题描述: 本来是想用dictionary来绑定combox的,结果给报了这么一个错。

解决方法:在网上查了一下,

Code
comboBoxPlanResult.DataSource =new BindingSource(o,null);
comboBoxPlanResult.DisplayMember
="Key";
comboBoxPlanResult.ValueMember
="Value"
;

即可解决该问题。

参考:http://www.cnblogs.com/winzheng/archive/2008/12/02/1345669.html

抱歉!评论已关闭.