我想在按钮单击事件上在gridview中创建组合框...每次当我单击按钮时,都会在下一行中创建一个组合框..意味着每次只有行将更改列将保持不变...
private void Buttton_Click(object sender, Event e)
{
DataGridViewComboBoxCell CellColumn1, CellColumn2, CellColumn3;
dataGridView1.Columns.Add("Col1", "Column1");
dataGridView1.Columns.Add("Col2", "sanjeev");
//make row 1 at all columns into combobox cell
dataGridView1.Rows[j].Cells[0] = new DataGridViewComboBoxCell();
dataGridView1.Rows[j].Cells[1] = new DataGridViewComboBoxCell();
CellColumn1 = (DataGridViewComboBoxCell)this.dataGridView1.Rows[j].Cells[0];
CellColumn2 = (DataGridViewComboBoxCell)this.dataGridView1.Rows[j].Cells[1];
j++;
}
我试过这个逻辑..这只会在第一次按钮点击时在gridview中创建combox但是当我再次点击按钮时这不起作用..
谁能帮我吗....