﻿<?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 - How to determine if First Row is being Added or Last Row has been Deleted?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-determine-if-First-Row-is-being-Added-or-Last-Row-has-been-Deleted/</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>How to determine if First Row is being Added or Last Row has been Deleted?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-determine-if-First-Row-is-being-Added-or-Last-Row-has-been-Deleted/</link><pubDate>Fri, 12 Mar 2010 03:54:25 GMT</pubDate><dc:creator>Glayaar</dc:creator><description>&lt;p&gt;You could use the ISDataSource selected event handler to buffer rows count of the selecting query retrun value object. The ISDataSource selected event will be triggered before WebGrid OnAddRow and OnDeleteRow.  &lt;/p&gt;&lt;p&gt;Here is the snippet to buffer the rows count of Customers table:&lt;/p&gt;&lt;pre&gt;protected void ISDataSource1_Selected(object sender, ISNet.WebUI.DataSource.ISDataSourceStatusEventArgs e)&lt;br /&gt;{&lt;br /&gt;    if (((DataTable)e.ReturnValue).TableName == "Customers")&lt;br /&gt;    {&lt;br /&gt;        rowCount = ((DataTable)e.ReturnValue).Rows.Count;&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>How to determine if First Row is being Added or Last Row has been Deleted?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-determine-if-First-Row-is-being-Added-or-Last-Row-has-been-Deleted/</link><pubDate>Thu, 11 Mar 2010 21:40:45 GMT</pubDate><dc:creator>DJBadin</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;With a WebGrid, how can I determine if First Row is being Added or Last Row has been Deleted?&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;I have a WebGrid with an ISDataSource.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;I have tried the following but can't figure out a valid WebGrid Count:&lt;/p&gt;
&lt;p&gt;- WebGrid.OnAddRow Event &lt;br /&gt;- ISDataSource.OnInserting Event&lt;/p&gt;
&lt;p&gt;I need to know this before the row is added so I can supply a Foreign Key to the Row being Added.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;- WebGrid.OnDeletedRow Event&lt;br /&gt;- ISDataSource.OnDeleted Event&lt;/p&gt;
&lt;p&gt;I need to know this after the last row of the WebGrid is deleted so I can delete a Parent Table Row using the Foreign Key of the Row being Deleted.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Doug&lt;/p&gt;</description></item></channel></rss>