ReoGrid performs the following cell edit flow:
When the user presses F2 or inputted any characters (including inputted from IME tool), ReoGrid will stop other processes and change operation status to Edit mode, before displaying the input field on screen, ReoGrid will invoke the BeforeCellEdit event. This event provides the argument
IsCanncelled which is used to cancel the edit operation. If editing is allowed, an input field will be displayed on the screen and the focus will be moved to it.
While the user is inputting text into the input field, ReoGrid will invoke the
CellEditCharInputted event, the
CellEditTextChanging event is raised when the user changes the text, it doesn’t matter how the text is inputted, such as direct input, copy/paste or in other ways. The
CellEditCharInputted event is raised when any characters are received from the user, including Unicode character from IME tool, this event provides arguments that allow user code to change the input characters.
In WPF edition,
CellEditCharInputted event can check a inputted character but cannot modify it, to modify text consider to use
After the user presses the ‘Enter’ key or moved focus out from the input field, the edit process will be terminated. The events
CellDataChanged will be invoked after edit operation is finished. Note that when the user presses the ‘Escape’ key, the edit operation will be cancelled by ReoGrid and the data user inputted will be restore to the data before editing, the
AfterCellEdit will be invoked but
CellDataChanged will not.
AfterCellEdit vs. CellDataChanged
AfterCellEdit provides a chance to abort or cancel the edit operation even after the user has finished inputting. Returning the
AfterCellEditEventArgs will cause the edit operation to be aborted, the data will be restored to the data before the edit started. The
CellDataChanged event is raised when data is changed in any way, including when the
SetCellData method is called or when data is pasted from the clipboard. It is the final event to observe and change the cell data.