Making a commit when new row is not the CurrentAddItem anymore?

When I try to commit the changes when the added row is not the CurrentAddItem anymore because I've moved to some other row to make any modification. Problem is as the new row lose focus and a commit is called it shows the following error:


What I want is to make multiple changes in a table like adding new rows, removing some rows and editing some information and then finally making a commit.

I'm using sfDataGrid.View.CommitNew() to save new rows but it fails when the Selected Row is not the new row anymore. 

Further making a sfDataGrid.View.CommitEdit() to save any edits in existing rows it fails with the following error:



Please tell If I'm doing it completely wrong?

Edit: Also please tell if CommitEdit() is required to call after deleting a record? 

1 Reply 1 reply marked as answer

DM Dhanasekar Mohanraj Syncfusion Team December 30, 2020 11:45 AM UTC

Hi Shankul gupta, 

Thank you for using Syncfusion controls. 

Once you Added the new row you should be commit this if you do some other process like Editing and Delete CurrentAddItem is removed that’s why the exceptions are thrown. 
Please let us know if you have any other queries.  

Regards,
Dhanasekar Mohanraj. 


Marked as answer
Loader.
Up arrow icon