I have a DataGridView and Checkbox column attached to it. I would like to achieve something like this, when a few checkboxes are selected, it will compare the cells value of column named Description between those selected row. If the values are not same, a message box will be show up, else the value will be parse into a textbox.
As in example above, a messagebox should be show up when those rows are selected.
This is what i have done so far and i don't know how to continue from here.
private void datagridview1_CellClick(object sender, DataGridViewCellEventArgs e)
{
foreach (DataGridViewRow r in datagridview1.Rows)
{
bool ckboxselected = !Convert.ToBoolean(r.Cells[0].Value);
if (e.RowIndex >= 0 && e.ColumnIndex == 0)
{
if (ckboxselected)
{
//compare
}
else
{
//another action
}
}
}
}
I appreciate you help!