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

[Solved] Change the text that appears for NextPages / PrevPages

2 Answers 81 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 15 Apr 2009, 06:06 PM
Hi,

I'm wondering if there is a way to specify what text I want for the "NextPages" / "PreviousPages" in the RadGrid PAger Control. I see there is a property for NextPagesToolTip but there is not one for NextPagesText. I would like to display "Next Pages" instead of "...".

1 2 3 4 5 6 7 8 9 10 ... I want to be 1 2 3 4 5 6 7 8 9 10 Next Pages

Thanks

<PagerStyle Mode="NumericPages" Position="TopAndBottom" CssClass="ListingsPageing" PrevPageImageUrl="/images/prev.jpg" NextPageImageUrl="/images/next.jpg"></PagerStyle>

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 16 Apr 2009, 04:38 AM
Hi Matt,

One workaround will be to access the linkbutton with the text "..." from the Pager item in the code behind and then set it text as "NextPage". Give a try with the following code snippet and see whether it helps.

CS:
 
 protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) 
    { 
      
        if (e.Item is GridPagerItem) 
        { 
            GridPagerItem pager = (GridPagerItem)e.Item; 
            LinkButton lnkbtn = (LinkButton)pager.FindControl("ctl22"); 
            if (lnkbtn != null
        
        } 
    } 


Thanks
Shinu
0
Matt
Top achievements
Rank 1
answered on 16 Apr 2009, 12:52 PM
Thanks Shinu,


    if (e.Item is GridPagerItem)  
        {  
            GridPagerItem pager = (GridPagerItem)e.Item;  
            LinkButton lnk1 = null;  
            LinkButton lnk2 = null;  
            LinkButton lnk3 = null;  
            try 
            {  
              lnk1  = (LinkButton)pager.FindControl("ctl01");                   
            }  
            catch { }  
 
            try 
            {                 
                lnk2 = (LinkButton)pager.FindControl("ctl11");                  
            }  
            catch { }  
 
            try 
            {  
                lnk3 = (LinkButton)pager.FindControl("ctl12");  
            }  
            catch { }  
 
            if (lnk3 != null)  
            {  
                if (lnk3.Text == "...")  
                {  
                    lnk3.Text = "NEXT PAGES";  
                }  
            }              
              
                if (lnk2 != null)  
                {  
                    if (lnk2.Text == "...")  
                    {  
                        lnk2.Text = "NEXT PAGES";  
                    }  
                }  
              
            if(lnk1 != null)  
            {  
                if(lnk1.Text == "...")  
                {  
                    lnk1.Text = "PREV PAGES";  
                }  
            }  
        } 
Tags
Grid
Asked by
Matt
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Matt
Top achievements
Rank 1
Share this question
or