﻿<?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 : How do I get the current page of the grid in the code behind?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid--How-do-I-get-the-current-page-of-the-grid-in-the-code-behind/</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 : How do I get the current page of the grid in the code behind?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid--How-do-I-get-the-current-page-of-the-grid-in-the-code-behind/</link><pubDate>Sun, 27 Feb 2011 23:50:06 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;&lt;p&gt;This cannot be done in server side. You only can do it in client side with OnAfterInitialize event and run below code.&lt;br /&gt;&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;var grid=ISGetObject("WebGrid1");
grid.GotoPage(2);
&lt;/pre&gt;
&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;
&lt;p /&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>WebGrid : How do I get the current page of the grid in the code behind?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid--How-do-I-get-the-current-page-of-the-grid-in-the-code-behind/</link><pubDate>Fri, 25 Feb 2011 10:41:18 GMT</pubDate><dc:creator>jcrendulic</dc:creator><description>&lt;p&gt;How do I set the grid to load that specific page in the code behind instead of loading the first page?&lt;/p&gt;</description></item><item><title>WebGrid : How do I get the current page of the grid in the code behind?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid--How-do-I-get-the-current-page-of-the-grid-in-the-code-behind/</link><pubDate>Thu, 24 Feb 2011 23:35:13 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;&lt;p&gt;Normally, you could not get it from server side because there is no method or property for this scenario. &lt;br /&gt;It only can be done via javascritp. However, you can pass the data from client(javascript) to server.&lt;/p&gt;
&lt;p&gt;E.g&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;function WebGrid1_OnAfterResponseProcess(controlId, actionName, lastRequestObject, xmlResponseObject)
        {
            if (actionName != "Custom")
            {
                var WebGrid1 = ISGetObject(controlId);
                var pageIndex = WebGrid1.CurrentPageIndex;
                WebGrid1.AddInput("pageIndex", pageIndex.toString()); 
                WebGrid1.SendCustomRequest();
            }
            return true;
        }&lt;/pre&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="font-family: 'courier new', tahoma; "&gt;&lt;span style="font-size: 12px; white-space: pre; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;pre&gt;&amp;nbsp;&lt;span style="font-family: 'lucida sans unicode'; white-space: normal; font-size: 13px; "&gt;protected void WebGrid1_InitializePostBack(object sender, ISNet.WebUI.WebGrid.PostbackEventArgs e)&lt;/span&gt;   {
     if (e.Action == ISNet.WebUI.WebGrid.PostBackAction.Custom)
     {
          pageIndex = Request["pageIndex"] as string;
     }
   }&lt;/pre&gt;
&lt;p&gt;Regards,&lt;br /&gt;Handy &lt;/p&gt;
&lt;p /&gt;</description></item><item><title>WebGrid : How do I get the current page of the grid in the code behind?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid--How-do-I-get-the-current-page-of-the-grid-in-the-code-behind/</link><pubDate>Thu, 24 Feb 2011 11:58:56 GMT</pubDate><dc:creator>jcrendulic</dc:creator><description>&lt;p&gt;I have a scenario where a grid has multiple pages....the user clicks page 5 ]on the grid.  I want to be able to save that they are on page 5 of the grid when the leave the page.  I also want to set the grid back to that page when they come back the grid. &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;How do I get the current page of the grid in the code behind?  Also, how do I set the grid back to that page in the code behind?&lt;/p&gt;</description></item></channel></rss>