here in
example if checkbox cell of particular row is cecked then I am changing color of row ...
Use
CurrentCellDirtyStateChanged event put color changing code stuff inside
Private void dgv1_CurrentCellDirtyStateChanged(Object sender, System.EventArgs e)
{
If (dgv1.IsCurrentCellDirty)
{
dgv1.CommitEdit(DataGridViewDataErrorContexts.Commit)
If (dgv1.CurrentCell.ColumnIndex == 1)
{
oCell = dgv1.Rows[dgv1.CurrentCell.RowIndex].Cells[0] as DataGridViewCheckBoxCell;
bool bChecked = (null != oCell && null != oCell.Value && true == (bool)oCell.Value);
if (true == bChecked)
{
dgv1.Rows[dgv1.CurrentCell.RowIndex].DefaultCellStyle.BackColor = Color.Yellow;
}
else
{
dgv1.Rows[dgv1.CurrentCell.RowIndex].DefaultCellStyle.BackColor = Color.Green;
}
}
}
}
Happy Coding!
:)