I have two ckecboxes (Error and Enable) as under
If I uncheck "Enable" checkbox, the corrresponding "Error" checkbox will become greyed out.
I tried like the below but there is no enable or disable property
void dgRulesMaster_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex > -1 & e.ColumnIndex == 3)
{
var editingCellFormattedValue = Convert.ToBoolean(((DataGridViewCheckBoxCell)dgRulesMaster.Rows[dgRulesMaster.CurrentRow.Index].Cells[3]).EditingCellFormattedValue);
if (editingCellFormattedValue == false)
{
dgRulesMaster[2, e.RowIndex].ReadOnly = true;
}
}
}
Again, use a custom painting (I love it :), I suppose the Cell should look like Disable when it's ReadOnly, of course it applies only on
DataGridViewCheckBoxColumn
, here is my code: