﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - WebGrid Enterprise - Cannot perform this operation on a row not in the table - Delete a row</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Cannot-perform-this-operation-on-a-row-not-in-the-table---Delete-a-row/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>Cannot perform this operation on a row not in the table - Delete a row</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Cannot-perform-this-operation-on-a-row-not-in-the-table---Delete-a-row/</link><pubDate>Thu, 20 May 2010 10:13:49 GMT</pubDate><dc:creator>michaelc</dc:creator><description>&lt;p&gt;Thanks Glenn,&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;I applied the changes and it now works.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Michael&lt;/p&gt;</description></item><item><title>Cannot perform this operation on a row not in the table - Delete a row</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Cannot-perform-this-operation-on-a-row-not-in-the-table---Delete-a-row/</link><pubDate>Wed, 19 May 2010 22:20:53 GMT</pubDate><dc:creator>Glayaar</dc:creator><description>&lt;p&gt;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.&lt;/p&gt;&lt;p&gt;In order to resolve the issue please add this line before returning the ds value in LoadData function:&lt;/p&gt;&lt;pre&gt;ds.AcceptChanges();&lt;/pre&gt;
&lt;p&gt;I also suggest adding primary key to the datatable since you are setting PrimaryKeyID field as a DataKeyField in the WebGrid&lt;/p&gt;&lt;pre&gt;dtFields.PrimaryKey = new DataColumn[] { dtFields.Columns["PrimaryKeyID"] };&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Cannot perform this operation on a row not in the table - Delete a row</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Cannot-perform-this-operation-on-a-row-not-in-the-table---Delete-a-row/</link><pubDate>Wed, 19 May 2010 17:12:27 GMT</pubDate><dc:creator>michaelc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;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:&lt;/p&gt;
&lt;p&gt;Cannot perform this operation on a row not in the table.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Any help would be appreciated. Please see attached code.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Michael&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item></channel></rss>