The official release of Ext.NET Mobile is now available. Ext.NET Mobile is an ASP.NET component framework for building Phone and Tablet specific mobile web applications. Read More

How to bind dataset to GridPanel with paging programatically??

  1. #1

    How to bind dataset to GridPanel with paging programatically??

    Hi,
    I already have a dataset from a method that i got number of rows and pagecount.
    I need 2 things;
    - I have the totalnumber of rows returned from my Stored Procedure. I need to set the page count of the GridPanel's pager programmatically.
    - How can i handle the event for the next and previous page button on the bottombar so i can run my SP again with the new pageindex.
    - When I click the column header for sorting, It only sorts the visible rows. I need to get a new DataSet according to the sort criteria. How can I trigger that?




    I'm pasting my current code below.
    I'll be glad if you can help me.
    Thanks.



    ASPX
    <ext:Store ID="Store1" runat="server" AutoLoad="true" RemoteSort="true">
            <AutoLoadParams>
                <ext:Parameter Name="start" Value="={0}" />
                <ext:Parameter Name="limit" Value="10" />
            </AutoLoadParams>
            <Reader>
                <ext:JsonReader ReaderID="id">
                    <Fields>
                        <ext:RecordField Name="GumrukAdi" />
                    </Fields>
                </ext:JsonReader>
            </Reader>
        </ext:Store>
        <ext:GridPanel runat="server" ID="GridPanel1" Title="Employees" Frame="true" StoreID="Store1" Height="300">
            <ColumnModel ID="ColumnModel1" runat="server">
                <Columns>
                    <ext:Column DataIndex="GumrukAdi" Header="Gumruk Adi" Width="150" />
                </Columns>
            </ColumnModel>
            <View>
                <ext:GridView ID="GridView1" runat="server" EnableRowBody="true">
                    <GetRowClass Handler="rowParams.body = '<p>'+record.data.Notes+'</p>'; return 'x-grid3-row-expanded';" />
                </ext:GridView>
            </View>
            <SelectionModel>
                <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" />
            </SelectionModel>
            <BottomBar>
            </BottomBar>
            <LoadMask ShowMask="true" />
        </ext:GridPanel>
    ASPX.CS

    int totalCount = 0; //Number of rows found
    int start = 0;
    int columnId= 1;
    int orderBy = 1;
    
    DataTable dtInfo = Database.GetEMployeeList(start,
                count,
                columnId,
                orderBy,
                out totalCount).Tables[0];
    
    Store1.DataSource = dtInfo;
    Store1.DataBind();
  2. #2

    RE: How to bind dataset to GridPanel with paging programatically??

    Hi,

    Please see the following sample


    http://examples1.ext.net/#/GridPanel...g_and_Sorting/



    Vladimir Shcheglov
    Sr. Developer

Similar Threads

  1. Replies: 3
    Last Post: Mar 19, 2013, 9:05 PM
  2. GridPanel with DataSet, where am I wrong?
    By MADSON in forum 1.x Help
    Replies: 4
    Last Post: Apr 08, 2012, 5:45 PM
  3. Replies: 2
    Last Post: Oct 06, 2011, 8:40 AM
  4. [CLOSED] Change heigth of gridpanel programatically in javascript
    By Pablo_Azevedo in forum 1.x Premium Help
    Replies: 5
    Last Post: Aug 12, 2011, 7:18 PM
  5. Replies: 2
    Last Post: Nov 17, 2009, 1:26 PM

Posting Permissions

Subscribe now to get the latest Ext.NET happenings in our newsletter.