Hi,
i've populated the grid with all the records (600) during the asp.net page loading and ncessary grid settings too. for example, VirtualItemCount and set the pagesize=100. the pager is properly showing the number of pages and the number of records.
What i want to do is to show data of one page at a time which means once the asp.net page is loaded it will show the first page content which is doing upon the first load. Now when a user clicks on the next button, the grid should show the next page content. I don't wana do the poast back because all the data is already binded with the grid. it is just a matter of displaying per page.
i've implemneted grid1_Command on client side to avoid post back whenever a user will click any button on the pager. Now i need to ask you what setting i need to do either with the grid or master table to show the next page content?
please note that when i click the next button the pager, its status gets change to 2 of 6 page but the grid still shows first 100 records whereas it should show 101-200 records.
Thanks.
function grid1_Command(sender, args) {
args.set_cancel(true);
var cmdName = args.get_commandName();
if (cmdName == 'Page') {
var cmdArg = args.get_commandArgument();
switch (cmdArg) {
case "Next":
break;
}
}
}
I've following settings on the grid. i'm purposely omitting the columns part.
<telerik:RadGrid ID="grid1" runat="server" AutoGenerateColumns="False"
EnableEmbeddedSkins="False" Skin="Grid" EnableViewState="true"
PageSize="100" AllowPaging="true" AllowSorting="true" HorizontalAlign="Left"
GridLines="None" Width="100%" Height="100%" AllowMultiRowSelection="true">
<MasterTableView Width="100%" CellPadding="0" EnableTheming="False" CanRetrieveAllData="true"
GridLines="None" GroupsDefaultExpanded="False" HorizontalAlign="Left" TableLayout="Fixed"
HeaderStyle-HorizontalAlign="Left" AllowMultiColumnSorting="false"
AllowNaturalSort="true" AllowCustomSorting="false" ShowHeadersWhenNoRecords="true"> <SortExpressions>
<telerik:GridSortExpression FieldName="CreationDate" SortOrder="Descending" />
</SortExpressions>
<PagerStyle AlwaysVisible="true" Height="25px" Width="100%" Mode="NextPrev" />
</MasterTableView>
<ClientSettings EnablePostBackOnRowClick="false" EnableRowHoverStyle="true" AllowColumnHide="true">
<Selecting AllowRowSelect="True" />
<Scrolling AllowScroll="true" UseStaticHeaders="true" SaveScrollPosition="true" ScrollHeight="100%" FrozenColumnsCount="0" />
<ClientEvents OnCommand="grdModelSearch_Command" OnRowSelecting="RowSelecting" OnRowSelected="RowSelected" OnRowDeselected="RowDeselected" OnRowDblClick="RowDoubleClicked" />
<Resizing AllowColumnResize="true" />
</ClientSettings>
<SortingSettings EnableSkinSortStyles="false" />
</telerik:RadGrid>