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

Remove paging with just a single page

1 Answer 84 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Neil
Top achievements
Rank 1
Neil asked on 20 Apr 2010, 08:07 PM
I would like to be able to remove paging on my rad Grid when there is only a single page, instead of the single [1] being added.  I tried adding AlwaysVisible="false" in the <PagerStyle but no luck.  Any ideas?

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 21 Apr 2010, 07:16 AM

Hello Neil,

The AlwaysVisible property is working fine when I tried on my end. It hides the pagerItem when there is only one page when setting AlwaysVisible="false" (I am using RadControls version 2010.1.309.35).

You can also accomplish the same by using following code snippet.

C#:

 
    protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)  
    {  
        if (e.Item is GridPagerItem)  
        {  
            GridPagerItem pagerItem = (GridPagerItem)e.Item;  
            if (RadGrid1.PageCount == 1)  
            {  
                pagerItem.Visible = false;  
            }  
        }  
    } 

-Shinu.

Tags
Grid
Asked by
Neil
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or