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

[Solved] Prevent users from changing page size

2 Answers 187 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 02 Jul 2009, 09:39 PM
How can i prevent users from changing the pagesize in the grid?

I want them to be able to page throught the records, but not change it

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 03 Jul 2009, 05:35 AM
Hello Jason,

You can either disable the page size combobox so that the user cannot change the page size:
c#:
 protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) 
    { 
        if (e.Item is GridPagerItem) 
        { 
            GridPagerItem pagerItem = (GridPagerItem)e.Item; 
            RadComboBox combo = (RadComboBox)pagerItem.FindControl("PageSizeComboBox"); 
            combo.Enabled = false;          
 
        } 
    } 

or you can hide the pageSize label and pagesize combobox(pager advanced part) by using the following css setting:
css:
.rgPager .rgAdvPart   
     {   
       
     display:none
      
     }  

Thanks
Princy.
0
Jason
Top achievements
Rank 1
answered on 03 Jul 2009, 12:49 PM
Perfect, thank you.
Tags
Grid
Asked by
Jason
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Jason
Top achievements
Rank 1
Share this question
or