iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi,
I have a basic scenario where a grid is databound in the code behind to a dataset containing one datatable, when I try to delete a row from the UI, I get a javascript alert with the following message:
Cannot perform this operation on a row not in the table.
Upon inspecting the cached datasource on postback, I noticed that the row has been deleted but not the UI side, the row still shows up. If I try re-deleting row, an exception is thrown this time.
This behavior does not happen when the row is first edited, then deleted or if a new row is added, then the same newly added row deleted, if any original row is deleted, it triggers this error.
Any help would be appreciated. Please see attached code.
Thanks
Michael
Based on my analysis of the attached code, the issue occurs because you have just add the rows to the table and have not invoked AcceptChanges method.
In order to resolve the issue please add this line before returning the ds value in LoadData function:
ds.AcceptChanges();
I also suggest adding primary key to the datatable since you are setting PrimaryKeyID field as a DataKeyField in the WebGrid
dtFields.PrimaryKey = new DataColumn[] { dtFields.Columns["PrimaryKeyID"] };
Thanks Glenn,
I applied the changes and it now works.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname