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

Disable Page Sizing Dropdown Option

8 Answers 481 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Stephen
Top achievements
Rank 1
Stephen asked on 06 Oct 2009, 12:01 PM
I have a RadGrid that is residing on a small RadWindow.  I want to disable/disallow the Page Size dropdown option on the grid interface.  How can this be done?  Thanks for any help in advance.

8 Answers, 1 is accepted

Sort by
0
Accepted
Sebastian
Telerik team
answered on 06 Oct 2009, 12:28 PM
Hello Stephen,

You can locate the page size combobox by its id (see this topic for details) wiring the ItemCreated server event of the grid. Then simply set its Enabled/Visible property to false to disable/hide it from the pager.

Best regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Accepted
Princy
Top achievements
Rank 2
answered on 06 Oct 2009, 12:46 PM
Hello Stephen,

An alternative solution would be to try out the following css setting inorder to hide the page size part from the pager:
css:
.rgAdvPart   
   {   
    display:none
   } 

Thanks
Princy.
0
Stephen
Top achievements
Rank 1
answered on 06 Oct 2009, 05:21 PM
The "OnItemCreated" method works when the grid first gets initialized, but when paging the Page Size Combobox shows up again.  This may have something to do with my RadAjax settings, not sure.
0
Sebastian
Telerik team
answered on 07 Oct 2009, 08:15 AM
Hello Stephen,

Generally, the ItemCreated event of the grid is raised on each postback as explained in this documentation topic. Therefore, if the code which hides it is processed every time the page size combobox should not be displayed.
 
Best regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Stephen
Top achievements
Rank 1
answered on 07 Oct 2009, 11:50 AM
True, this event fires every time there is a postback but the visible =  false is not holding and once again when the grid 1st appears the controls are not visible, but when paging they are. Even after I remove the AJAX this is still true.  Please help.
0
Sebastian
Telerik team
answered on 07 Oct 2009, 12:32 PM
Hi Stephen,

Can you double-check that the code inside your ItemCreated handler (which hides the page size combobox) gets executed each time? You may also consider the solution with css proposed by our MVP Princy as an alternative.

Regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Stephen
Top achievements
Rank 1
answered on 07 Oct 2009, 12:51 PM
I just stumbled upon the solution to my issue ... in my PageIndexChanged event I was disposing my grid object.  Once I removed that, it worked perfect.  Thanks again for your assistance.
0
he
Top achievements
Rank 1
answered on 05 Jul 2013, 03:08 AM
<PagerStyle ... PageSizeControlType="None"... />
Tags
Grid
Asked by
Stephen
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Princy
Top achievements
Rank 2
Stephen
Top achievements
Rank 1
he
Top achievements
Rank 1
Share this question
or