且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如果在c#的datagridview中选中了复选框,则只选择组合框

更新时间:2023-02-09 09:34:33

对代码进行一些更改

Make a little change in your code
dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;



并且在GridView1_CellStateChanged事件中没有直接应用此


and in the GridView1_CellStateChanged event without directly applying this

SplitMethod.ReadOnly = true;// it will always make the whole column readonly



尝试使用这个


try using this

dataGridView1.CurrentRow.Cells[i].ReadOnly = true;//i is the column index of the combobox column



如需进一步查询,请随时询问。


For further query feel free to ask.