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

RadGrid PagerStyle question

2 Answers 113 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nasir
Top achievements
Rank 1
Nasir asked on 09 Apr 2012, 11:39 AM
Guys i want to replace grid built in icon for next page that is > and prev page is <
which i have done as 
PagerTextFormat="Välj sida: <a onclick='javascript:openPreviousPage();'><img src='../Images/newimages/left_singel_arrow.png' style='cursor:pointer;' title='Previous' /></a> {4} <a onclick='javascript:openNextPage();'><img src='../Images/newimages/right_singel_arrow.png' style='cursor:pointer;' title='Next' /></a> &nbsp;&nbsp; Visar sida {0} av {1}, post {2} till {3} av {5}"

then i have hide the > and < as 
GridPagerItem pager = (GridPagerItem)e.Item;            
            hdnPageCount.Value = pager.Paging.PageCount.ToString();            
            pager.PagerContentCell.Controls[1].Visible = false; //&lt if page count = 5                        
            if (pager.Paging.PageCount <= 5)
            {
                if (pager.Paging.PageCount == 1)
                {
                    pager.PagerContentCell.Controls[5].Visible = false;//&gt if page count=1 then it is on 5
                }
                if (pager.Paging.PageCount == 2)
                {
                    pager.PagerContentCell.Controls[7].Visible = false;//&gt if page count=2 then it is on 7
                }
                if (pager.Paging.PageCount == 3)
                {
                    pager.PagerContentCell.Controls[9].Visible = false; //&gt if page count=3 then it is on 9
                }
                if (pager.Paging.PageCount == 4)
                {
                    pager.PagerContentCell.Controls[11].Visible = false; //&gt if page count=4 then it is on 9
                }
                if (pager.Paging.PageCount == 5)
                {
                    pager.PagerContentCell.Controls[13].Visible = false;//&gt if page count = 5 then 13 
                }                                
            }
but the problem is that  when there are thousands of pages, it is impossible to get pager control index.
how to hide parmanently &gt and &lt from pagerStyle.?????
Note: i have used my own Next Page and Prev Page images instead of built in <, > 

2 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 09 Apr 2012, 02:09 PM
Hello Nasir,

Please check below link/demo.
Grid / Pager Template

Thanks,
Jayesh Goyani
0
Nasir
Top achievements
Rank 1
answered on 09 Apr 2012, 02:17 PM
i have checked but i could not find the solution.
which hide the default radgrid paging buttons. that are Prev page <. Next Page > 
Tags
Grid
Asked by
Nasir
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Nasir
Top achievements
Rank 1
Share this question
or