Introduction
Here I will explain at a time only one check box should be selected in a particular row.
You can use CellEndEdit Event or CellLeave event
when ever you will leave the cell after doing edits this event will fire. In the following snippet Column1 is your first checkbox and Column2 is your other checkbox.
Here I will explain at a time only one check box should be selected in a particular row.
You can use CellEndEdit Event or CellLeave event
when ever you will leave the cell after doing edits this event will fire. In the following snippet Column1 is your first checkbox and Column2 is your other checkbox.
private void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
{
if (Convert.ToBoolean(dataGridView1.Rows[e.RowIndex].Cells["Column1"].Value))
dataGridView1.Rows[e.RowIndex].Cells["Column2"].Value
= false;
}
|
0 comments :
Post a Comment