NullReferenceException in SfDataGrid when Pressing Escape?

the exception occurs only whenever i double click the id cell to edit then press escape after i finish.

i am using a custom Selection Controller for the grid but odly the problem occurs with or without the custom selection controller.

i also tried diffrent version of syncfusion : 17.4.0.39, 17.4.0.46, 18.1.0.36 .

Note: i attached a sample project to reproduce the issue.

Attachment: SampleApp_ede415dc.rar

3 Replies

VS Vijayarasan Sivanandham Syncfusion Team March 30, 2020 02:45 PM UTC

 
We have analyzed your sample and Can you please confirm issue occurs only on SfDataGrid when enter the edit mode in AddNewRow by double click the ID cell column and then pressing escape key. 
 
Regards,
Vijayarasan S  



JO Joseph March 30, 2020 05:42 PM UTC

after looking at the problem a bit closer i found that it goes away if i use the MappingName property instead of the ValueBinding when defining the GridTextColumn which is strange?


VS Vijayarasan Sivanandham Syncfusion Team March 31, 2020 11:19 AM UTC

Hi Joseph,

Thanks for the Update.

If you are using the ValueBinding property to display the value in SfDataGrid. So, you can enable the UseBindingValue property to True for resolve the issue. Please refer the below code snippet,

 
<syncfusion:SfDataGrid Name="dataGrid" ItemsSource="{Binding Items, Mode=OneWay}"  AllowDrop="True" AllowDraggingRows="True" SelectedItem="{Binding SelectedItem, Mode=OneWayToSource}" AllowEditing="True" AllowDeleting="True" AddNewRowPosition="Top">
            <syncfusion:SfDataGrid.Columns>
                <syncfusion:GridTextColumn HeaderText="ID" UseBindingValue="True" ValueBinding="{Binding ID}" />
                <syncfusion:GridTextColumn HeaderText="Name" UseBindingValue="True" ValueBinding="{Binding Name}" />
                <syncfusion:GridTextColumn HeaderText="Address" UseBindingValue="True" ValueBinding="{Binding Address}" />
                <syncfusion:GridTextColumn HeaderText="PhoneNum" UseBindingValue="True" ValueBinding="{Binding PhoneNum}" />
            </syncfusion:SfDataGrid.Columns>
</
syncfusion:SfDataGrid> 
Regards,
Vijayarasan S 


Loader.
Up arrow icon