关于datagridview的datagridviewcomboBoxColumn问题 我已经绑定了cobobox的数据源,也可以正常下拉选择,但是,我把dgv的allowuseraddrow的属性改为FALSE后,不允许添加行,下拉列表就不见了,请问谁知道这是什么问题,怎么解决? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 是不是改错属性了?看看DGV的ReadOnly属性。 如果lz确定没有改错属性的话,可能要一行一行的combox去绑定了 我确定没有错应该,现在DGV上只有一个绑定的,现在情况是我只要选择下拉列表,在关闭后,会自动添加新的一行,所以我不想让他添加,但我调为不添加后,COMBO就不见了 DataGridViewComboBoxColumn com = (DataGridViewComboBoxColumn)dataGridView5.Columns[2]; com.Items.Clear(); for (int i = 0; i < 3; i++) { com.Items.Add(i.ToString()); } dataGridView5.RowCount = 3; dataGridView5.Rows[0].Cells[0].Value = "1"; dataGridView5.Rows[0].Cells[1].Value = "张三"; dataGridView5.Rows[0].Cells[2].Value = "1"; dataGridView5.Rows[1].Cells[0].Value = "2"; dataGridView5.Rows[1].Cells[1].Value = "李四"; dataGridView5.Rows[1].Cells[2].Value = "1"; dataGridView5.Rows[2].Cells[0].Value = "3"; dataGridView5.Rows[2].Cells[1].Value = "王五"; dataGridView5.Rows[2].Cells[2].Value = "2";这是我测试程序的代码,我将allowuseraddrow设置为false了,这样好像没错哦 楼上的,我忘记设dgv的rowcount数量了,所以有问题,谢谢,现在设置了rowcount,已经可以像预想的了 请教用什么方法不用登陆客户端,后台能直接定时调用界面(一个地址)? C#用匿名方法添加事件的问题 请教Winfrom里的DataGridView分页怎么写? 页面提交问题 收集2G多的电子书,免费提供 正则问题 怎样实现c#中的中的datatime的比较? 如何添加IE控件,using SHDocVw; 动态生成控件不响应事件的问题(100分) 想让大神帮忙解释下这段代码 详细点 C# 在屏幕画线的问题 web services安全性
DataGridViewComboBoxColumn com = (DataGridViewComboBoxColumn)dataGridView5.Columns[2];
com.Items.Clear();
for (int i = 0; i < 3; i++)
{
com.Items.Add(i.ToString());
} dataGridView5.RowCount = 3;
dataGridView5.Rows[0].Cells[0].Value = "1";
dataGridView5.Rows[0].Cells[1].Value = "张三";
dataGridView5.Rows[0].Cells[2].Value = "1";
dataGridView5.Rows[1].Cells[0].Value = "2";
dataGridView5.Rows[1].Cells[1].Value = "李四";
dataGridView5.Rows[1].Cells[2].Value = "1";
dataGridView5.Rows[2].Cells[0].Value = "3";
dataGridView5.Rows[2].Cells[1].Value = "王五";
dataGridView5.Rows[2].Cells[2].Value = "2";
这是我测试程序的代码,我将allowuseraddrow设置为false了,这样好像没错哦