Jan 29, 2009, 9:14 AM
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
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.CSint 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();