I have a SfGrid using EditMode.Batch with a DetailTemplate.
For any changed rows, the context for the DetailTemplate shows the old record rather than changed one.
So for a newly added record, any changes that were made in the OnBatchAdd event callback are shown correctly in the context in DetailTemplate but any changes that were made by editing columns in the grid (or programmatically) are not.
Please advise on how to access or get the changed record?
Greetings from Syncfusion support.
We have analyzed your query and suspect that you want to get the values of chaged records. If so we suggest you to use GetBatchChanges method of DataGrid. It will contain the changed records from the batch edit. Kindly get back to us if you have any further queries.
Thank you for your reply.
The solution you describe by using GetBatchChanges will not work when there are more than 1 new items. This is because the id of the newly added items is 0, and we are unable to determine which specific Added record in GetBatchChanges the DetailTemplate is referring to.
The only solution to this is by using a temporary index that we add to each class. The index then has to be managed as well leading to a very inelegant solution.
Since the grid is managing the mapping between the rows original record and the changed record, the best solution would be for the DetailTemplate to refer to the changed record AND the original record.
Thanks for an update.
Based on your query, we suspect that you issue has been resolved by some work around.
If still you’re facing anu issue, please get back to us.