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

How can I hide Page Size control in RadGrid Pager ?

3 Answers 572 Views
Grid
This is a migrated thread and some comments may be shown as answers.
gafoor
Top achievements
Rank 1
gafoor asked on 16 Jan 2015, 04:56 PM
Hi,

RadGrid is configured with PagerStyle-Mode "NextPrevNumericAndAdvanced".  Goto Page and Page size controls are coming as expected.  
I want to display only Goto page but not Page Size controls.  Also I want to display Goto Page option right after the page numbers.  Please find attachment.  I am able to do it with css as follows:

.RadGrid .rgPager .rgAdvPart [id*="ChangePageSize"]
{
    display:none;
}
div.RadGrid .rgPager .rgAdvPart     
{     
    float:left;


  Do you have any property or method to do this?

3 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 21 Jan 2015, 10:07 AM
Hello Gafoor,

Generally, you can use the following property to hide the page size combo:
<PagerStyle ... PageSizeControlType="None" />

Hope this helps.

Regards,
Eyup
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
gafoor
Top achievements
Rank 1
answered on 21 Jan 2015, 05:15 PM
Hi Eyup,

Thanks for your time.  

I already verified PageSizeControlType="None" property.  its working when Mode="NextPrevAndNumeric"

<PagerStyle Mode="NextPrevAndNumeric" PageSizeControlType="None"/>


but not when Mode="NextPrevNumericAndAdvanced"

<PagerStyle Mode="NextPrevNumericAndAdvanced" PageSizeControlType="None"/>

Do I need to set any other property along with PageSizeControlType="None" when Mode="NextPrevNumericAndAdvanced" ?
0
Eyup
Telerik team
answered on 26 Jan 2015, 02:53 PM
Hello Gafoor,

There is no built-in property for this specific requirement, however, you can use the following approach to achieve it:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
    if (e.Item is GridPagerItem)
    {
        GridPagerItem pager = e.Item as GridPagerItem;
        foreach (string id in new string[] {
            "ChangePageSizeLabel", "ChangePageSizeTextBox",
            "ChangePageSizeLinkButton" })
        {
            pager.FindControl(id).Visible = false;
        }
    }
}

Please give it a try and let me know if it works for you.

Regards,
Eyup
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
gafoor
Top achievements
Rank 1
Answers by
Eyup
Telerik team
gafoor
Top achievements
Rank 1
Share this question
or