i want to run CellEndEdit only when value of cell is changed, tried putting
if (dataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString() == e.For
You could definitely get there by catching the current cell value in CellBeginEdit
, then comparing it to the current cell value in CellEndEdit
. (Or use your CellValidation
trick.)
To avoid "multiple flags", you could use a Dictionary
so you can key into the dictionary with the current event's grid, then get or set the appropriate value.