Results 1 to 2 of 2

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

  1. #1
    Member
    Join Date
    Jan 2009
    Location
    Posts
    5

    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
    Code:
    <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

    Code:
    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
    Ext.NET - Dev Team Vladimir's Avatar
    Join Date
    Mar 2008
    Location
    Russia
    Posts
    15,356

    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
    Ext.NET, Inc.
    Development Team

    Ext.NET Examples | Ext.NET API Docs | ExtJS API Docs | Twitter | Jobs

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