|
|
@@ -27,9 +27,19 @@ namespace UAS_MES.CustomControl.DataGrid_View
|
|
|
|
|
|
private void DataGridViewWithSerialNum_CellContentClick(object sender, DataGridViewCellEventArgs e)
|
|
|
{
|
|
|
- if (Columns[0] is DataGridViewCheckBoxColumn && e.ColumnIndex > 0)
|
|
|
+ if (Columns[0] is DataGridViewCheckBoxColumn && e.ColumnIndex >= 0 && e.RowIndex >= 0)
|
|
|
{
|
|
|
- Rows[e.RowIndex].Cells[0].Value = true;
|
|
|
+ if (!(Columns[e.ColumnIndex] is DataGridViewCheckBoxColumn))
|
|
|
+ {
|
|
|
+ if (Rows[e.RowIndex].Cells[0].Value.ToString() == "0")
|
|
|
+ {
|
|
|
+ Rows[e.RowIndex].Cells[0].Value = 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Rows[e.RowIndex].Cells[0].Value = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|