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

[Solved] Prevent Custom Paging in RadGrid

3 Answers 111 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andreas
Top achievements
Rank 1
Andreas asked on 10 Nov 2009, 02:29 PM
Hi All,

I am trying to change the footer of the RadGrid where it says "Page Size = 5". Acutally I have set the property of Customer Paging allowed to false, but the Grid still shows the customer paging (so that the customer can change from page size 5 to 10, etc.)

I want to prevent that the customer can decide by himself which page size the Grid show have as any page size above 5 crashes my webpage (its too large then and jumps out of my HTML div).

How would it possible to solve this?

Any hints are very much appreciated.

Best wishes

Andi

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 11 Nov 2009, 06:24 AM
Hello Andi,

You can hide the pagesize part from your pager row using the following css setting:
css:
.rgAdvPart  
{  
    displaynone;  
}  

Thanks
Princy.
0
Andreas
Top achievements
Rank 1
answered on 11 Nov 2009, 03:00 PM
Hi Princy,

many thanks for your quick reply.

I inserted the code you were suggesting into my style sheet. It somehow worked, but now the whole paging part is away.

I want to keep the arrows for going from one page to another within the grid, but I want to avoid that the customer can change the "Page size". Is there any other CSS class / attribute I can use in order to achieve this?

Many thanks!!

Andi
0
Princy
Top achievements
Rank 2
answered on 12 Nov 2009, 05:43 AM
Hello Andi,

Probably you can try out the following code to hide the PageSize combo and label:
c#:
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) 
    { 
        if (e.Item is GridPagerItem) 
        { 
            GridPagerItem pager = (GridPagerItem)e.Item; 
            Label lbl = (Label)pager.FindControl("ChangePageSizeLabel"); 
            lbl.Visible = false
            RadComboBox PageSizeComboBox = (RadComboBox)pager.FindControl("PageSizeComboBox"); 
            PageSizeComboBox.Visible = false
        }  
    } 

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