5
votes

In DataGridView I have CellValueChanged event, when user modify any cell value, this event is fired. When user modify one cell, value 1 is changed to 2, then user click the next cell and press Escape, value in first cell is changed from 2 to 1, CellValueChanged event isn't fired. I keep values in temporary lists of object, and I have update values in these lists too. Which event is fired when user press escape and comes out from editing control mode ?

Thanks

2

2 Answers

3
votes

React to the CellEndEdit event.

0
votes

There is also this place:

    // Implements the IDataGridViewEditingControl.GetEditingControlFormattedValue method.
    public object GetEditingControlFormattedValue(DataGridViewDataErrorContexts context)
    {            
        if (context.ToString() == "Parsing, Commit")
        {
            // Do something here
        }

        return EditingControlFormattedValue;
    }