This is a migrated thread and some comments may be shown as answers.
disable grid paging arrows
6 Answers 106 Views
This is a migrated thread and some comments may be shown as answers.
rcfausto
Top achievements
Rank 1
rcfausto asked on 21 Feb 2012, 04:38 AM
Hi Telerik,

How to disable "previous & first page" arrow buttons on page 1 and "next & last page" arrows when on last page?
Also disabling all arrows when row count is less than the page size?

Appreciate your help. Thanks!

6 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 21 Feb 2012, 05:26 AM
Hello,

Try the following code.
C#:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
 if (e.Item is GridPagerItem)
 {
  GridPagerItem pagerItem=(GridPagerItem)e.Item;
  if (pagerItem.Paging.IsFirstPage)
  pagerItem.CssClass = "RadFirstPage";
  else if (pagerItem.Paging.IsLastPage)
  pagerItem.CssClass = "RadLastPage";
 }
}

CSS:
<style type="text/css">
       .RadFirstPage .rgPageFirst, .RadFirstPage .rgPagePrev
       {
           display: none !important;
       }
       .RadLastPage .rgPageNext, .RadLastPage .rgPageLast
       {
           display: none !important;
       }
</style>

-Shinu.
0
Kamel
Top achievements
Rank 1
answered on 23 Feb 2012, 12:41 PM
Dear Shinu,
I tried the below and it works only if I am using the default skin images,
if I am specifying image urls by using NextPageImageUrl="images/nextpage.gif", the images don't disappear.

Any turn around for this?
Best Regards.
0
Antonio Stoilkov
Telerik team
answered on 28 Feb 2012, 07:43 AM
Hello Kamel,

You could achieve your scenario by modifying the provided CSS with the sample below. The idea is to hide the hole section where the next and prev buttons reside.
.RadFirstPage .rgArrPart1
{
    display: none;
}
         
.RadLastPage .rgArrPart2
{
    display: none;
}


Regards,
Antonio Stoilkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Oksana
Top achievements
Rank 1
answered on 11 Oct 2012, 02:30 PM
Is there a way to disable the buttons rather than hide them?
0
Shinu
Top achievements
Rank 1
answered on 12 Oct 2012, 04:51 AM
Hi,

One suggestion is that you can set the opacity property to disable the buttons.
CSS:
.RadFirstPage .rgArrPart1
{
    opacity:0.4
}

Thanks,
Shinu.
0
Bill
Top achievements
Rank 1
answered on 25 Jan 2013, 07:54 PM
Hi,
This works nicely if you want to hide the buttons, but the question was can you disable them?
I also would like to disable them but still have them display so that the pager grid section is not jumping to different left/right positions as the user pages through the grid.

I imagine this needs to be done via some properties of the controls and not via the style as its not a display change but rather a functionality change.
Thank you
Tags
Grid
Asked by
rcfausto
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Kamel
Top achievements
Rank 1
Antonio Stoilkov
Telerik team
Oksana
Top achievements
Rank 1
Bill
Top achievements
Rank 1
Share this question
or