Situation:
Master/Detail view datagrid with editable column in DetailsViewDataGrid.
Current cell in DetailsViewDataGrid is in edit mode, with underlying TextBox defined in EditTemplate. Text editing is possible. In this case we require to observe the TextBox's Enter Key Pressed event to commit the editor changes to the source binding from code.
We followed the suggestions to extend GridSelectionController and use the "ProcessKeyDown" to set the Enter Key as handled there.
Observed Behavior:
Cell is in edit mode, enter key correctly bubbles to TextBox key pressed event, cell stays in edit mode.
When clicking with the Mouse Pointer to a different cell, NullException occurs in SfDataGrid. See attached images.
Expected Behavior:
When clicking with the Mouse Pointer to a different cell, the edit mode on the current cell is ending (Step 1) and then focus is set to cell where Mouse Pointer is located over (Step 2). Without NullException.
Related CurrentCellEndEdit and CurrentCellActivated events are triggered.
Other observations:
For easier handling and implementing of special use cases on the UI, it would be beneficial to be able to receive also all keys - which are handled in the GridSelectionController and taken over there - as RoutedEvents to be used e.g. in a Behavior. We spent hours to implement a SfTextBoxExt textbox in the DetailsView Edit Template with a customized SuggestionsProvider and to get the final edited text into the source binding. Issue is that the GridSelectionController "consumes" all key events and adding a respective event listeners works, sometimes don't and in all cases not reliably.
Attachment:
GridSelectionControllerExt_d6957240.zip