DataGridViewComboBoxColumn用法总结
为DataGridView添加下拉列:
设定值:
设置单击下拉模式(否则需要点两下才能显示下拉框):
DataGridViewComboBoxColumn colShow = new DataGridViewComboBoxColumn();
colShow.Name = "spaceType";
colShow.HeaderText = "空间类型";
colShow.Width = 200;
colShow.Items.Add("选项一");
colShow.Items.Add("选项二");
colShow.Name = "spaceType";
colShow.HeaderText = "空间类型";
colShow.Width = 200;
colShow.Items.Add("选项一");
colShow.Items.Add("选项二");
colShow.DisplayIndex = 0;
dataGridView1.Columns.Insert(0, colShow);
dataGridView1.Rows[1].Cells[2].Value = "选项二";
DataGridView属性 EditMode 为 EditOnEnter
EditingControlShowing += new DataGridViewEditingControlShowingEventHandler(dgv_EditingControlShowing);
url:http://greatverve.cnblogs.com/archive/2012/02/01/DataGridViewComboBoxColumn.html
EditingControlShowing += new DataGridViewEditingControlShowingEventHandler(dgv_EditingControlShowing);
我这个博客废弃不用了,今天想寻找外链的时候,突然想到这个博客权重很高。
有需要免费外链的,留言即可,我准备把这个博客变成免费的友情链接站点。