Faced a problem: if you edit the field in the DGV, by which the table is sorted, the edited line changes its position (the sorting works). I need after I enter the value in the string, process it, and the string "runs away". What to do?

    1 answer 1

    1. Add a field to the class that stores the last modified cell.
    2. In the CellBeginEdit handler, remember the cell.
    3. In the CellEndEdit handler, process the cell using the stored value.

    You can also check when the CellParsing, CellStateChanged events are triggered — possibly before sorting.