How to select Item from DataGridViewComboBoxCell in Datagridview
-
hello, I have a Combobox in My Grid. I have bound this Combobox by datasource. Suppose values in Combobox After binding (x,y,z); I have a checkbox on form. i get some value like "x" After clicking on checkbox, what i want when i click on checkbox this x value should be selected in ComboBox. for this I'm trying following code DataGridViewComboBoxCell cboCell = this.dgvQueryPane.Rows[CurrentRowIndex].Cells[CurrentCellName] as DataGridViewComboBoxCell; cboCell.Value = x; but its not working....can anyone please help me.....
Amit Agarwal
-
hello, I have a Combobox in My Grid. I have bound this Combobox by datasource. Suppose values in Combobox After binding (x,y,z); I have a checkbox on form. i get some value like "x" After clicking on checkbox, what i want when i click on checkbox this x value should be selected in ComboBox. for this I'm trying following code DataGridViewComboBoxCell cboCell = this.dgvQueryPane.Rows[CurrentRowIndex].Cells[CurrentCellName] as DataGridViewComboBoxCell; cboCell.Value = x; but its not working....can anyone please help me.....
Amit Agarwal
While I have never used the combo in a gridview I would expect you to have to set the
selectedvalue = X
of the combo NOT the cell. BTW you posted C# in the VB forum :)Never underestimate the power of human stupidity RAH