我创建了一个DataGridView控件,其中第一列是一个复选框。当我单击“在复选框中”时,代码将正确执行。但是,当单击发生在单元格中但不在复选框中时,代码将正确处理复选框的状态,但不会更新复选框本身,因此它仍处于单击之前的状态。 private void myDataGrid_CellClick(object sender, DataGridViewCellEventArgs e) if (e.RowIndex == -1) return; //check if row index is not selected
DataGrid