﻿<?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 Filtered Rows of webgrid in server side</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Get-Filtered-Rows-of-webgrid-in-server-side/</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 Filtered Rows of webgrid in server side</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Get-Filtered-Rows-of-webgrid-in-server-side/</link><pubDate>Mon, 23 Aug 2010 00:30:50 GMT</pubDate><dc:creator>Glayaar</dc:creator><description>&lt;p&gt;Based on my disucssion with the developer regarding this issue, for this scenario he suggest not to use the programmatic binding and GetCachedDataSource method. He suggest using binding the ObjectDataSource control ID to the WebGrid using the DataSourceID property. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;In order to retrieve the filtered row count, you will need to use the RootTable rows count property if the grid is not using any paging. If the grid is using paging, you will need to retrieve the DataView rows count from one of the RootTable rows. Here is the snippet for the WebGrid with paging enabled:&lt;/p&gt;&lt;pre&gt;int rowCount = 0;&lt;br /&gt;if(WebGrid1.RootTable.Rows.Count &amp;gt; 0)&lt;br /&gt;{&lt;br /&gt;    rowCount = ((DataRowView)(WebGrid1.RootTable.Rows[0].DataRow)).DataView.Count;&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item><item><title>Get Filtered Rows of webgrid in server side</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Get-Filtered-Rows-of-webgrid-in-server-side/</link><pubDate>Fri, 20 Aug 2010 04:54:25 GMT</pubDate><dc:creator>Glayaar</dc:creator><description>&lt;p&gt;Testing the code using ObjectDataSource I also encounter the same issue. I am still discussing this issue with the developer. Currently, as a workaround you will need to bind the individual column manually similar to client binding scenario. &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Get Filtered Rows of webgrid in server side</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Get-Filtered-Rows-of-webgrid-in-server-side/</link><pubDate>Thu, 19 Aug 2010 13:17:42 GMT</pubDate><dc:creator>babman</dc:creator><description>&lt;p&gt;Glenn,&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;If I do that in the InitializeDataSource event handler, then I also have to add this to my PrepareDataBinding handler:&lt;/p&gt;
&lt;p&gt;   If (Not IsPostBack) Then&lt;br /&gt;            WebGrid1.RetrieveStructure()&lt;br /&gt;   End If&lt;/p&gt;
&lt;p&gt;Doing that, however, causes the following error (on the RetrieveStructure line):&lt;/p&gt;
&lt;p&gt;  [NullReferenceException: Object reference not set to an instance of an object.]&lt;br /&gt;   ISNet.WebUI.WebGrid.WebGrid.RetrieveStructure() &amp;#43;711&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Brian&lt;/p&gt;</description></item><item><title>Get Filtered Rows of webgrid in server side</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Get-Filtered-Rows-of-webgrid-in-server-side/</link><pubDate>Tue, 17 Aug 2010 22:48:19 GMT</pubDate><dc:creator>Glayaar</dc:creator><description>&lt;p&gt;In order for the GetCachedDataSource to have a value, you will need to bind the data using InitializeDataSource server side event. Even if you are using ObjectDataSource, under such scenario, the GetCachedDataSource already returned the dataview object.&lt;/p&gt;&lt;p&gt;Here is the InitializeDataSource event handler:&lt;/p&gt;&lt;pre&gt;protected void WebGrid1_InitializeDataSource(object sender, ISNet.WebUI.WebGrid.DataSourceEventArgs e)&lt;br /&gt;{&lt;br /&gt;    e.DataSource = ObjectDataSource1.Select();&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Get Filtered Rows of webgrid in server side</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Get-Filtered-Rows-of-webgrid-in-server-side/</link><pubDate>Tue, 17 Aug 2010 16:24:05 GMT</pubDate><dc:creator>babman</dc:creator><description>&lt;p&gt;What if we can't use a DataTable?  We have a WebGrid that uses an objectdatasource to retrieve about 90000 records.  GetCacheDataSource returns nothing, and our project must use an objectdatasource.&lt;/p&gt;
&lt;p&gt;Is there any way to get the filtered rows, server-side?&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;</description></item><item><title>Get Filtered Rows of webgrid in server side</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Get-Filtered-Rows-of-webgrid-in-server-side/</link><pubDate>Thu, 18 Feb 2010 00:10:35 GMT</pubDate><dc:creator>vinsdeon</dc:creator><description>&lt;p&gt;Thanks for the solution. It worked.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Get Filtered Rows of webgrid in server side</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Get-Filtered-Rows-of-webgrid-in-server-side/</link><pubDate>Mon, 15 Feb 2010 22:23:51 GMT</pubDate><dc:creator>Glayaar</dc:creator><description>&lt;p&gt;After filtering WebGrid, if the DataSource is DataTable, you will need to get the DataSource using GetCacheDataSource() method. This will return all the Row in the WebGrid. If you would like to retrieve the filtered row you will need to use the DataTable DefaultView property.&lt;/p&gt;&lt;p&gt;Here is the snippet:&lt;/p&gt;&lt;pre&gt;((DataTable)[GridObject].GetCachedDataSource()).DefaultView&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 Filtered Rows of webgrid in server side</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Get-Filtered-Rows-of-webgrid-in-server-side/</link><pubDate>Mon, 15 Feb 2010 01:16:39 GMT</pubDate><dc:creator>vinsdeon</dc:creator><description>&lt;p&gt;I have a webgrid with 30k rows. After a filtering it reduces to 500 rows. Now from server i would like to get these datarows together in a table or get the filtered data in a dataset or whatever possible as a form of datasource. How is it possible?&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>