[NullException] In SfDataGrid / DetailsView - GridCurrentCellManager : CanSelectRowOrCell(RowColumnIndex rowColumnIndex)

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

1 Reply

VS Vijayarasan Sivanandham Syncfusion Team August 18, 2021 03:29 PM UTC

Hi Michael Pillwax, 

Thank you for contacting Syncfusion Support. 

Based on provided information we have checked the reported issue “Null reference exception occurs in MasterDetailsViewDataGrid” and unable to replicate the issue from our end. It is working fine as expected. Please find the tested sample and video demo from our end in the link below, 
        1. Provide the replication procedure with video illustration of the reported issue

 
if you are still facing the same issue? If yes, please modify the sample based on your scenario. 

It will be helpful for us to check on it and provide you the solution at the earliest. 

Regards, 
Vijayarasan S 


Loader.
Up arrow icon