﻿<?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 - Error after DeleteRow event - Cannot perform this operation on a row not in a table</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Error-after-DeleteRow-event---Cannot-perform-this-operation-on-a-row-not-in-a-table/</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>Error after DeleteRow event - Cannot perform this operation on a row not in a table</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Error-after-DeleteRow-event---Cannot-perform-this-operation-on-a-row-not-in-a-table/</link><pubDate>Thu, 03 Jun 2010 23:34:10 GMT</pubDate><dc:creator>Glayaar</dc:creator><description>Here is the DeleteRow event handler for manually bound data set, I am using OleDBDataAdapter in order to fill the dataset:&lt;br /&gt;&lt;pre&gt;void WebGrid1_DeleteRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e)&lt;br /&gt;{&lt;br /&gt;    DataSet ds = (DataSet)WebGrid1.DataSource;&lt;br /&gt;    ((DataRowView)e.Row.DataRow).Row.Delete();&lt;br /&gt;    da.Update(ds);&lt;br /&gt;    e.ReturnValue = false;&lt;br /&gt;}&lt;/pre&gt;You will need to manually call the delete function for the deleted row and using data adapter to persist the change to the database. You will also need to set the ReturnValue to false for such scenario in order to avoid any further process done by WebGrid to the deleted row.&amp;nbsp; &lt;br /&gt;</description></item><item><title>Error after DeleteRow event - Cannot perform this operation on a row not in a table</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Error-after-DeleteRow-event---Cannot-perform-this-operation-on-a-row-not-in-a-table/</link><pubDate>Thu, 03 Jun 2010 17:21:12 GMT</pubDate><dc:creator>mdearman@libera.com</dc:creator><description>&lt;p&gt;I have a grid manually bound to a DataSet and am handling the DeleteRow event with custom code.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;I noticed the grid does not automatically set the underlying DataRow object to the Deleted state.&lt;br /&gt;The row currently has the RowState of Unchanged.&lt;br /&gt;I need to call the DataRow.Delete method on this row so that my data adapter can see that the row was deleted properly.&lt;/p&gt;
&lt;p&gt;However, during the DeleteRow process I call the AcceptChanges method so that the DataSet is committed properly.  This makes the row Detached.&lt;/p&gt;
&lt;p&gt;Immediately after leaving the DeleteRow event, the WebGrid throws an internal error "Cannot perform an operation on a row not in the table".&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;What is the proper order/methods to call to properly delete a DataRow in the underlying data source and have it delete the WebGridRow without error in the grid.  The above methods used to work in WebGrid 3.5 but now doesn't in WebGrid 7.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Mike&lt;/p&gt;</description></item></channel></rss>