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

Radgrid page size disappears

3 Answers 781 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jeremy
Top achievements
Rank 1
Jeremy asked on 12 Feb 2015, 02:42 PM
I'm using a radgrid with paging and page size on my site.  But for some reason, the page size dropdown disappears when I make it big enough to display all the results on one page.  So if there are 21 record in the radgrid and I set the page size to 50 then the page size dropdown disappears.  The pagination controls disappear as well but that makes sense.  But I need to give the users the ability to go back to displaying 10 records if they want.  
<telerik:RadGrid ID="AdministratorRadGrid" runat="server" AllowPaging="True" AllowSorting="true" OnItemCommand="AdministratorRadGrid_ItemCommand"
    OnSortCommand="AdministratorRadGrid_SortCommand" OnPageSizeChanged="AdministratorRadGrid_PageSizeChanged"
    OnPageIndexChanged="AdministratorRadGrid_PageIndexChanged" PagerStyle-Position="TopAndBottom">
    <MasterTableView AutoGenerateColumns="False" DataKeyNames="BWUserRoleID">
        <Columns>
            <telerik:GridBoundColumn DataField="BWUserRoleID" HeaderText="ID" ReadOnly="true" Visible="true"></telerik:GridBoundColumn>
           <telerik:GridBoundColumn DataField="DisplayName" HeaderText="Name" ReadOnly="true" FilterControlWidth="150px" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Title" HeaderText="Title" ReadOnly="true" FilterControlWidth="50px" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="UserID" HeaderText="ID" ReadOnly="true" FilterControlWidth="50px" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="RoleID" HeaderText="Role ID" FilterControlWidth="50px" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Description" HeaderText="Description" ReadOnly="true" FilterControlWidth="50px" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"></telerik:GridBoundColumn>
            <telerik:GridButtonColumn ButtonType="PushButton" CommandName="AdminActivate" Text="Edit Admin Status" Resizable="false"></telerik:GridButtonColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>


3 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 13 Feb 2015, 11:08 AM
Hello,

To prevent disappearing of grid pager you should set PagerStyle-AlwaysVisible property to true.

Regards,
Pavlina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Jeremy
Top achievements
Rank 1
answered on 13 Feb 2015, 03:15 PM
Hi Pavlina,
Thanks for your response.  That worked.  However, this seems unintuitive and creates needless UI issues the user isn't going to like.  Let's me explain.  The default behavior is once the page size is greater than the result set then the paging and the page size dropdown disappear.  So by default, the user doesn't get the ability to reduce the page size after that or set it back to default.  If you add PagerStyle-AlwaysVisible="true" then the user has the ability to do that.  This is good.  But that means it's ALWAYS visible...even if there is only one record in the grid.  Some of my users will get annoyed that the pagination controls and page size are there when it's not needed.  The footer with all those controls could be bigger than the actual result set.  That's annoying.
0
Pavlina
Telerik team
answered on 18 Feb 2015, 03:52 PM
Hi Jeremy,

Currently this is the way grid paging is working. If you want pager to be always visible even when the items in the grid are less than the page size(this is also valid for the case when you have only one item in the grid) you should set AlwaysVisible property to true. When this property is false the pager will disappear after you select larger page size. Unfortunately there is no third mode which works the way you want. 

Regards,
Pavlina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Jeremy
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Jeremy
Top achievements
Rank 1
Share this question
or