﻿<?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 - Get row count in SmartBatchUpdateScenario</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Get-row-count-in-SmartBatchUpdateScenario/</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>Get row count in SmartBatchUpdateScenario</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Get-row-count-in-SmartBatchUpdateScenario/</link><pubDate>Thu, 08 Apr 2010 03:20:00 GMT</pubDate><dc:creator>hermancordes@gmail.com</dc:creator><category>WebGrid</category><category>rowcount</category><category>smartbatchupdatescenario</category><category>smartbatch</category><description>&lt;p&gt;Nice solution, stupid I didn't realise this was an option too. Thanks!!&lt;/p&gt;</description></item><item><title>Get row count in SmartBatchUpdateScenario</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Get-row-count-in-SmartBatchUpdateScenario/</link><pubDate>Thu, 08 Apr 2010 00:48:29 GMT</pubDate><dc:creator>Glayaar</dc:creator><category>WebGrid</category><category>rowcount</category><category>smartbatchupdatescenario</category><category>smartbatch</category><description>&lt;p&gt;I did not found any attachment in your post. However based on my test on your scenario, you could use the GetRowByKeyValue client side function to determine if the row your are going to add has already exist. The function will return null if the row does not exist.&lt;/p&gt;&lt;p&gt;Here is a snippet:&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;grid.RootTable.GetRowByKeyValue(KeyValue);&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Get row count in SmartBatchUpdateScenario</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Get-row-count-in-SmartBatchUpdateScenario/</link><pubDate>Wed, 07 Apr 2010 03:30:48 GMT</pubDate><dc:creator>hermancordes@gmail.com</dc:creator><category>WebGrid</category><category>rowcount</category><category>smartbatchupdatescenario</category><category>smartbatch</category><description>&lt;p&gt;Hi Glenn,&lt;/p&gt;
&lt;p&gt;It actually concerns sample BatchUpdate1.aspx in the attached Batch.zip. &lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;In your scenario, which event handler are you using in an attempt to cancel the row addition? In your scenario, does the message occur after each pending changes or after accept all changes occurs? &lt;br /&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Let me describe the situation a little more. The webgrid is currently used in combination with a search box. The selected results (can be more than one), will be added to the 'container'/'selected results' webgrid. However, all results and record values will be added on clientside.&lt;/p&gt;
&lt;p&gt;Because of clientside addition (user can't interact at this point), no eventhandler of the webgrid is used. The records will be added if the user makes the selection of search results final. So for me, this is a logical place to check the record already exists (correct me if I'm wrong).&lt;/p&gt;
&lt;p&gt;If no check is applied or the check fails (as descriped in topic start), the WebGrid displays the message on the line where I call AddPendingChanges(). The message is: &lt;em&gt;The pending changes already contain a record with key 'x'&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;I hope this clearifies the situation and hope you'll have an idea of how to solve this problem.&lt;/p&gt;
&lt;p&gt;Thanks in advance!&lt;/p&gt;</description></item><item><title>Get row count in SmartBatchUpdateScenario</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Get-row-count-in-SmartBatchUpdateScenario/</link><pubDate>Wed, 07 Apr 2010 00:10:39 GMT</pubDate><dc:creator>Glayaar</dc:creator><category>WebGrid</category><category>rowcount</category><category>smartbatchupdatescenario</category><category>smartbatch</category><description>&lt;p&gt;In the provided sample BatchUpdate_Enterprise.aspx, I have tried the scenario you described, adding multiple row with duplicate KeyValue. However, internal WebGrid validation on every pending changes will already disallow such operation. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;In your scenario, which event handler are you using in an attempt to cancel the row addition? In your scenario, does the message occur after each pending changes or after accept all changes occurs? &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Get row count in SmartBatchUpdateScenario</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Get-row-count-in-SmartBatchUpdateScenario/</link><pubDate>Tue, 06 Apr 2010 06:02:12 GMT</pubDate><dc:creator>hermancordes@gmail.com</dc:creator><category>WebGrid</category><category>rowcount</category><category>smartbatchupdatescenario</category><category>smartbatch</category><description>&lt;p&gt;Currently I'm working with a SmartBatchUpdateScenario. However, the possibility exists that a record gets added with a duplicate KeyValue. The WebGrid gives me a decent error message about that, but I'd like to detect that in advance and suppress the message. The message is not relevant for users in my case.&lt;/p&gt;
&lt;p&gt;So my first solution to detect that case was to loop through all grid rows and check each keyvalue to the keyvalue of the record to be added. If a match is found, the record is not added. I'm encountering one problem hereby: the number of grid rows isn't returning the correct number of rows.&lt;/p&gt;
&lt;p&gt;Concrete steps:&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;The first row in an empty grid that will be added checks the KeyValue exists. The number of rows is 0, so it doesn't exist and will be added.&lt;/li&gt;&lt;li&gt;The second row in a grid (with one row) will check the KeyValue exists. However, the number of rows is still 0, so the record gets added. Even if this record is the same as the first one.&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;I'm using the attachment from this thread: &lt;a href="http://www.intersoftpt.com/Community/WebGrid/WebGrid-two-way-binding-issue/"&gt;http://www.intersoftpt.com/Community/WebGrid/WebGrid-two-way-binding-issue/&lt;/a&gt;. Several ways to get the row count:&lt;/p&gt;
&lt;p&gt;var grid = ISGetObject("WebGrid1");&lt;br /&gt;alert(grid.TotalLoadedRows); // Doesn't change after record has been added at client side.&lt;br /&gt;alert(grid.TotalRows);// Doesn't change after record has been added at client side.&lt;br /&gt;alert(grid.RootTable.Rows); // Is null.&lt;br /&gt;alert(grid.RootTable.Rows.length); // Throws error.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Questions:&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Am I doing something wrong with this solution?&lt;/li&gt;&lt;li&gt;Should I be using another property to obtain rowcount in a SmartBatchUpdateScenario?&lt;/li&gt;&lt;li&gt;Is there another way to detect duplicate KeyValues in rows?&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;Thanks in advance.&lt;/p&gt;</description></item></channel></rss>