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

how to hide pager First, Previous, Next, Last buttons

3 Answers 924 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bill
Top achievements
Rank 1
Bill asked on 23 Jan 2013, 09:38 PM

Can you tell me how I can hide the First, Previous, Next, and Last pager buttons in a radgrid?

I am able to hide the Page Size related controls in the code behind by using this code:
            Label changePageSizeLabel = (Label)e.Item.FindControl("ChangePageSizeLabel");
            changePageSizeLabel.Visible = false;
            Button changePageSizeLinkButton = (Button)e.Item.FindControl("ChangePageSizeLinkButton");
            changePageSizeLinkButton.Visible = false;
            RadNumericTextBox changePageSizeText = (RadNumericTextBox)e.Item.FindControl("ChangePageSizeTextBox");
            changePageSizeText.Visible = false;

And I am able to hide the text that displays next to those buttons in the markup by using this code:
<PagerStyle Mode="NextPrevNumericAndAdvanced" CssClass="quotePager" Position="TopAndBottom"  HorizontalAlign="Center" 
                        FirstPageText="" PrevPageText="" NextPageText="" LastPageText="" />

But I cannot figure out how to hide the buttons mentioned above?
Is there an ID I can use for each of them to find them and set them to visible=false in the code-behind?
Is there an attribute I can use for each of them to set them in the pagerstyle element in the markup?
Thank you

3 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 24 Jan 2013, 05:55 AM
Hi,

Try setting the following CSS.
CSS:
.RadGrid_Default .rgPagePrev
      {
          display: none !important;
      }
      .RadGrid_Default .rgPageNext
      {
          display: none !important;
      }
      .RadGrid .rgPageLast, .RadGrid .rgPageFirst
      {
          display: none !important;
      }

Thanks,
Shinu
0
Bill
Top achievements
Rank 1
answered on 24 Jan 2013, 04:07 PM
Thank you Shinu and Jayesh!

Shinu... Why do you have prev and next separate and then 1 line with first and last?

Anyway, this is working:

.RadGrid  .rgPageFirst, .RadGrid .rgPagePrev, .RadGrid .rgPageNext, .RadGrid .rgPageLast

 {

     display: none!important;

}


Tags
Grid
Asked by
Bill
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Shinu
Top achievements
Rank 2
Bill
Top achievements
Rank 1
Share this question
or