您的位置:首页 > 编程语言 > C#

c# 绑定控件(comboBoxEx1,dataGridView1)的数据源

2018-01-24 15:46 211 查看
//绑定comboBoxEx1的DataSourceDictionary insSet = ...;BindingSource bs = new BindingSource();bs.DataSource = insSet; this.comboBoxEx1.DataSource = bs;this.comboBoxEx1.DisplayMember = "Value";this.comboBoxEx1.ValueMember = "Key";
//绑定dataGridView1的DataSource1:DataTable dt = ...;this.dataGridView1.DataSource = dt;
2:Dictionary dictionary= new Dictionary();dataGridViewX1.DataSource = new BindingSource(dictionary,null);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: