C# ComboBox绑定及DataGridView禁止DataSource自动创建列

ComboBox绑定


DataTable dt = new DataTable
dt = //数据集
this.DisplayMember = //要显示属性的字段
this.DisplayMember.ValueMember
 =//要显示值的字
this.comboBox.DataSource = dt;

DataGridView禁止DataSource自动创建列

 

this.DataGridView.AutoGenerateColumns = false;

 

posted on 2012-06-19 15:39  空白画映  阅读(4318)  评论(0编辑  收藏  举报

导航