﻿<?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 - WebGrid and Custom Paging with Custom Objects</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-and-Custom-Paging-with-Custom-Objects/</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>WebGrid and Custom Paging with Custom Objects</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-and-Custom-Paging-with-Custom-Objects/</link><pubDate>Mon, 07 Jan 2013 06:09:50 GMT</pubDate><dc:creator>Hans</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;1) The GetPagedBugs (if you see ClientBiding_Paging.aspx sample) is being called twice indeed.&lt;br&gt;&lt;/br&gt;This happen due to the sample is using pagination feature. First, it will select all data then it will select again for the paging.&lt;/p&gt;
&lt;p&gt;2) If you are using Intersoft sample, it should use IHierarchicalList indeed, because data source collection of the sample is using hierarchical collection.&lt;br&gt;&lt;/br&gt;If you don’t the hierarchical collection, you should your own data source collection.&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br&gt;&lt;/br&gt;Hans.&lt;/p&gt;</description></item><item><title>WebGrid and Custom Paging with Custom Objects</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-and-Custom-Paging-with-Custom-Objects/</link><pubDate>Thu, 03 Jan 2013 11:44:53 GMT</pubDate><dc:creator>SteveExtend</dc:creator><description>&lt;p&gt;ISData Adapter Code:&lt;/p&gt;&lt;pre&gt;    public class CustomersISDataAdapter
    {
        public CustomersISDataAdapter()
        {
        }
        private Customers _lastCustomers = null;
        public CustomersISDataCollection GetData(string sortExpression, int maximumRows, int startRowIndex)
        {
            Customers items = Customers.GetCustomers(startRowIndex, maximumRows);
            this._lastCustomers = items;
            CustomersISDataCollection dataCollection = CustomersISDataCollection.CreateISDataCollection(items);
            return dataCollection;
        }
        public int SelectCount(string sortExpression)
        {
            return this._lastCustomers.MaxRowIndex;
        }
    }&lt;/pre&gt;
&lt;p&gt;For some reason the GetData method is always called twice.&lt;/p&gt;
&lt;p&gt;It's called twice when the page loads and twice everytime I page.&lt;br&gt;&lt;/br&gt;No grid events are being handled in the code behind. &lt;br&gt;&lt;/br&gt;&lt;/p&gt;
&lt;p&gt;I have two questions:&lt;br&gt;&lt;/br&gt;&lt;br&gt;&lt;/br&gt;1) How can I stop the GetData call being made twice.&lt;br&gt;&lt;/br&gt;2) Why does the return object of GetData need to inherit &lt;span style="color: rgb(43, 145, 175); font-family: consolas; font-size: 13px;"&gt;&lt;span style="color: rgb(43, 145, 175); font-family: consolas; font-size: 13px;"&gt;&lt;span style="color: rgb(43, 145, 175); font-family: consolas; font-size: 13px;"&gt;IHierarchicalList&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;. I can do theGrid.DataSource = theCustomers, where theCustomers is of type CUstomers, and it works fine...but returning a Customers object gives an error when using the ISDataSource saying the collection must implement IHierarchicalList. This means I have to take my customer objects and add them to a special collection before I return them.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;cheers,&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Steve&lt;/p&gt;&lt;span style="color: rgb(43, 145, 175); font-family: consolas; font-size: 13px;"&gt;&lt;span style="color: rgb(43, 145, 175); font-family: consolas; font-size: 13px;"&gt;&lt;span style="color: rgb(43, 145, 175); font-family: consolas; font-size: 13px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;</description></item><item><title>WebGrid and Custom Paging with Custom Objects</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-and-Custom-Paging-with-Custom-Objects/</link><pubDate>Thu, 03 Jan 2013 11:34:28 GMT</pubDate><dc:creator>SteveExtend</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have this almost working now.&lt;/p&gt;
&lt;p&gt;Page Source Source:&lt;br&gt;&lt;/br&gt;&lt;/p&gt;&lt;pre&gt;&amp;lt;ISWebGrid:WebGrid ID="WebGrid2" runat="server" Height="250px" 
    UseDefaultStyle="True" Width="500px" DataSourceID="ISDataSource1"&amp;gt;
    &amp;lt;LayoutSettings PagingLoadMode="Custom" PagingMode="ClassicPaging" 
        PagingStyleUI="Slider" PagingDataRetrievalMode="ReturnPartialRows" 
        PagingSize="20"&amp;gt;
    &amp;lt;/LayoutSettings&amp;gt;
    &amp;lt;RootTable&amp;gt;
        &amp;lt;Columns&amp;gt;
            &amp;lt;ISWebGrid:WebGridColumn Name="CustomerId" Caption="Customer Id" DataMember="CustomerId" /&amp;gt;
            &amp;lt;ISWebGrid:WebGridColumn Name="DisplayName" Caption="Display Name" DataMember="DisplayName" Width="200"/&amp;gt;
        &amp;lt;/Columns&amp;gt;
    &amp;lt;/RootTable&amp;gt;
&amp;lt;/ISWebGrid:WebGrid&amp;gt;
&amp;lt;ISDataSource:ISDataSource ID="ISDataSource1" runat="server" 
    SchemaType="CustomObject" LoadOnDemand="true"&amp;gt;
    &amp;lt;Tables&amp;gt;
        &amp;lt;ISDataSource:ISDataSourceTable SelectMethod="GetData" SelectCountMethod="SelectCount" TableName="Customers" EnablePaging="true"
            TypeName="WebGridPaging.CustomersISDataAdapter" &amp;gt;
        &amp;lt;/ISDataSource:ISDataSourceTable&amp;gt;
    &amp;lt;/Tables&amp;gt;
&amp;lt;/ISDataSource:ISDataSource&amp;gt;&lt;/pre&gt;
</description></item><item><title>WebGrid and Custom Paging with Custom Objects</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-and-Custom-Paging-with-Custom-Objects/</link><pubDate>Wed, 02 Jan 2013 02:44:20 GMT</pubDate><dc:creator>Hans</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Please forgive me for lack of understanding about the reported problem.&lt;/p&gt;
&lt;p&gt;Intersoft have WebGrid sample that maybe similar with your current scenario, WebGrid client binding with pagination.&lt;/p&gt;
&lt;p&gt;If you don’t mind, please kindly have review in the ClientBinding_Paging.aspx WebGrid samples and let us know your response.&lt;br&gt;&lt;/br&gt;(start &amp;gt; All Programs &amp;gt; Intersoft WebUI Studio 2012 R2 &amp;gt; WebUI Studio for ASP.NET &amp;gt; WebGrid 8 &amp;gt; C# Samples.&lt;br&gt;&lt;/br&gt;The physical location of the file is: "%ProgramFiles%\Intersoft Solutions\Intersoft WebUI Studio 2012 R2\Samples\For ASP.NET\ISNet.WebUI.Samples\cs\WebGrid\ClientBinding_Paging.aspx".)&lt;/p&gt;
&lt;p&gt;Regards,&lt;br&gt;&lt;/br&gt;Hans.&lt;/p&gt;</description></item><item><title>WebGrid and Custom Paging with Custom Objects</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-and-Custom-Paging-with-Custom-Objects/</link><pubDate>Sat, 29 Dec 2012 12:20:18 GMT</pubDate><dc:creator>SteveExtend</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am new to WebGrid development and I have been assigned a project that like all IT projects must be completed 2 weeks ago. I need to implement custom paging and I was wondering if anyone had any pointers. I've looked at the docs and tutorials and I'm not 100% sure how to handle it.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;We have a framework that has the following API call:&lt;br&gt;&lt;/br&gt;&lt;/p&gt;&lt;pre&gt;int customerId = 67; //This would be specified by a param in the query string of a Url.
int pageIndex = 3;
int pageSize = 25;
 
Users selectedUsers = Users.GetUsers(customerId, pageIndex, pageSize);
int maxPageIndex = selectedUsers.MaxPageIndex; //This is the maximum page index that should be shown on the grid
&lt;/pre&gt;
&lt;p&gt;This returns all users for a given customer, page index and page size. In the same call it also returns the maximum no of pages.&lt;br&gt;&lt;/br&gt;&lt;br&gt;&lt;/br&gt;This is an n-tiered and layers solution and the GetUsers call makes a special WCF service call to a remote workflow engine. This WCF Workflow Engine can be located anywhere in the world. The only data we have is the Users class as shown above.&lt;br&gt;&lt;/br&gt;&lt;br&gt;&lt;/br&gt;I have read articles about using a the ISDataSource control and creating a data adapter...but all these examples assume 3 things, 1) You're connecting to a Db and returning datatables and 2) The Db is located either on the server itself, or in the local environment (I base this on the fact there are two seperate methods that need to be implmented, a select data method and a get count) and 3) The get calls have no input params and cannot be filtered by customerId as in my above code.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Ideally what I am looking for is something like the following code snippet. I know this code doesn't exist....but this is the kind of functionality I am looking for:&lt;br&gt;&lt;/br&gt;&lt;/p&gt;&lt;pre&gt;WebGrid1.PagingEnabled = true;
WebGrid1.PagingMode = PagingMode.Classic;
Users selectedUsers = Users.GetUsers(this._customerId, 1, 25);
WebGrid1.DataSource = selectedUsers;
WebGrid1.MaxPageIndex = selectedUsers.MaxPageIndex;
private void WebGrid1_PageIndexSelected(object sender, PageIndexSelectedArgs args)
{
    Users selectedUsers = Users.GetUsers(this._customerId, args.SelectedPageIndex, 25);
    Webgrid1.DataSource = selectedUsers;
    WebGrid1.MaxPageIndex = selectedUsers.MaxPageIndex;
    WebGrid1.SelectedPageIndex = args.SelectedPageIndex;
}&lt;/pre&gt;
&lt;p&gt;In theory this should be VERY easy to implement....but I can find any examples of how to do this.&lt;br&gt;&lt;/br&gt;Can anyone help me out?&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;cheers,&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Steve&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item></channel></rss>