When referencing SfDataGrid, ASP.NET Boilerplate, and ChangeTracking, a null reference exception occurs.

I have attached the project file where the error occurs.

Two additional packages are being used:


  • After running the project, modifying the first row of SfDataGrid using the keyboard works fine.
  • However, when modifying the second row using the keyboard, an error occurs during the execution of the FindRowData method inside SfDataGrid.


The first row was programmatically modified with code like DataList.First().Name = "John Doe";.
Due to this, no error occurs with the first row.

If I remove the Abp package reference from the project, the error no longer occurs.
<PackageReference Include="Abp" Version="10.0.0" />
The error occurs simply by referencing this package.

What should I do? Please help me.


Attachment: SfGridWithChangeTrackingWithAbp_4fbaeec1.zip

5 Replies

SG Santhosh Govindasamy Syncfusion Team January 28, 2025 04:00 PM UTC

Hi Morgan Le Fay,

Thank you for reaching out.


From the provided information and sample, we were able to replicate the issue on our end. We are currently analyzing the issue, so we need some time to validate it. We will provide an update on or before January 30, 2025.

 

Regards,

Santhosh.G



SG Santhosh Govindasamy Syncfusion Team January 30, 2025 12:46 PM UTC

Hi Morgan Le Fay

Thanks for your patience.


From the information and sample provided, we were able to replicate the issue on our end. After analyzing it, we found that the AsTrackable method affects the existing behavior of editing. When the method is removed, editing works properly. Please note that the issue in the MS DataGrid with AsTrackable is that while performing editing, the exception doesn't occur, but the edit doesn't function correctly.


As we analyzed, the AsTrackable method is meant to enable automatic tracking of changes to an object or a collection of objects.


To proceed further, could you please share more details on what action you want to perform using AsTrackable? Kindly explain in detail because you haven’t mentioned any related operation involving AsTrackable.

This information will help us proceed further. Thanks for your cooperation, and we look forward to your response.


Regards,
Santhosh.G



ML Morgan Le Fay January 30, 2025 03:14 PM UTC

Hello, thank you so much for your quick response.

Here is my scenario:

This project is an administrative management tool.
The administrator modifies the data (DTO objects) received from the server using SfDataGrid, and the modified properties and values are visually distinguished by changing the cell’s background color.
All modified properties and values are displayed as a list to the administrator for final approval before being sent back to the server.
Additionally, the administrator should have the option to revert all modifications if needed.
Since there are quite a lot of different types of DTOs, the ChangeTracking package is used to track changes to the DTOs.

In an older WinForms project, the same functionality was already implemented, and now I am migrating it to WPF.
The WinForms project used SfDataGrid and PropertyGrid, but it did not use the ABP framework.

In the provided sample, removing the ABP package reference allows everything to work correctly, including AsTrackable.
This issue occurs only when ABP is included, and it took quite some effort to identify this correlation.

I am unsure whether the issue lies with SfDataGrid, ABP, or ChangeTracking.
Since this is a common usage pattern, I expected Syncfusion to provide the fastest alternative.

I truly appreciate your hard work and dedication.



SG Santhosh Govindasamy Syncfusion Team January 31, 2025 03:37 PM UTC

Hi Morgan Le Fay,

We are currently analyzing the scenario you reported. We need time to validate it, and we will provide an update on or before February 4, 2025.

Regards,
Santhosh.G



SG Santhosh Govindasamy Syncfusion Team February 4, 2025 11:08 AM UTC

Hi Morgan Le Fay,

Thank you for your patience.

We understand that you are using the AsTrackable method from the ChangeTracking package to track modifications in SfDataGrid. Based on our analysis, the issue arises when AsTrackable improperly triggers the NotifyCollectionChanged event during cell editing. This event attempts to reset the collection, leading to an exception.

Since cell editing modifies only a single property rather than altering the entire collection, this behavior is unintended. Specifically, when using AsTrackable, cell edits unexpectedly trigger NotifyCollectionChanged, which causes a collection reset.

To proceed further, could you please provide details on how you are implementing the AsTrackable method and any related ChangeTracking actions/methods on your end? Understanding this will help us identify a suitable resolution.

Looking forward to your response.

 
Regards,
Santhosh.G


Loader.
Up arrow icon