This is a migrated thread and some comments may be shown as answers.

How to retain grid pager

1 Answer 46 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nataraj Vedula
Top achievements
Rank 1
Nataraj Vedula asked on 20 Nov 2008, 04:59 AM
Hi,

I am using a rad grid with pagination in opur application. I have a small question on retaining the grid pager in a particular scenario. Please help me.

I have set the grid PageSize to 10. I bound dataset with 20 records to the grid. Pager displays 2 pages for the user to view the records(10 records per page). Now if user changes the pagesize as 20 using the pager, then a single page will be displayed to the user with all 20 records in it. And pager will be not be displayed to the user anymore.
Now, if user want to set the PageSize back to 10, he/she cannot see the pager. Is it any property I am missing out to keep this pager?
Below is my grid definition:
<telerik:RadGrid ID="PrivateQueryDataGrid" runat="server" AllowPaging="true" PageSize="10" 
Skin="Web20" PagerStyle-Mode="NextPrevNumericAndAdvanced" OnItemCommand="PrivateQueryDataGrid_ItemCommand" 
AutoGenerateColumns="False" GridLines="None" OnNeedDataSource="PrivateQueryDataGrid_NeedDataSource">  
<MasterTableView DataKeyNames="QueryID" ItemStyle-CssClass="GridItem" HeaderStyle-CssClass="Grid" 
CssClass="Grid" AlternatingItemStyle-CssClass="GridAltItem" RetrieveAllDataFields="false"<Columns> 
<telerik:GridBoundColumn DataField="QueryName" HeaderStyle-HorizontalAlign="Center" 
HeaderText="Query Name">  
</telerik:GridBoundColumn> 
<telerik:GridBoundColumn DataField="ReportName" HeaderStyle-HorizontalAlign="Center" 
HeaderText="Report Name">  
</telerik:GridBoundColumn> 
<telerik:GridBoundColumn DataField="FilterString" HeaderStyle-HorizontalAlign="Center" 
HeaderText="Filter String">  
</telerik:GridBoundColumn> 
<telerik:GridBoundColumn DataField="CreatedBy" HeaderStyle-HorizontalAlign="Center" HeaderText="Created By">  
</telerik:GridBoundColumn> 
</Columns> 
<RowIndicatorColumn> 
<HeaderStyle Width="20px" /> 
</RowIndicatorColumn> 
<ExpandCollapseColumn> 
<HeaderStyle Width="20px" /> 
</ExpandCollapseColumn> 
</MasterTableView> 
<ClientSettings EnablePostBackOnRowClick="true">  
<Resizing ClipCellContentOnResize="false" /> 
<Selecting AllowRowSelect="True" /> 
</ClientSettings> 
<FilterMenu EnableTheming="True">  
<CollapseAnimation Duration="200" Type="OutQuint" /> 
</FilterMenu> 
</telerik:RadGrid> 

Thanks in advance,
Nataraj

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 20 Nov 2008, 06:15 AM
Hello Nataraj,

You can try setting the PagerStyle-AlwaysVisible  property of the grid to true as shown below.
aspx:
<telerik:RadGrid ID="PrivateQueryDataGrid" runat="server" AllowPaging="true" PagerStyle-AlwaysVisible="true" PageSize="10" Skin="Web20" PagerStyle-Mode="NextPrevNumericAndAdvanced" OnItemCommand="PrivateQueryDataGrid_ItemCommand" AutoGenerateColumns="False" GridLines="None" OnNeedDataSource="PrivateQueryDataGrid_NeedDataSource">    
 ...... 
</telerik:RadGrid> 
 

Thanks
Princy.
 
Tags
Grid
Asked by
Nataraj Vedula
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or