private void dgv_PartsList_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex != 0 || e.RowIndex == -1) return;
for (int i = 0; i < dgv_PartsList.Rows.Count; i++)
{
DataGridViewCheckBoxCell checkcell = (DataGridViewCheckBoxCell)this.dgv_PartsList.Rows[i].Cells[0];
if (e.RowIndex == i){
checkcell.Value = !Convert.ToBoolean(checkcell.Value);
}else{
checkcell.Value = false;
}
}
}