How to hide the "First" and "Last" RadGrid's buttons

7 posts, 1 answers
  1. javier
    javier avatar
    48 posts
    Member since:
    Aug 2012

    Posted 31 Aug 2012 Link to this post

    Hi,

    I'm using a RadGrid and wit the NextPrev PagerStyle-Moded, anyway the grid displays the Next, Previous First and Last.
    I need to hid ethe First and Last

    Thank you,
  2. Answer
    Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 01 Sep 2012 Link to this post

    Hello,

    Please try with below code snippet.

    <style type="text/css">
           .RadGrid .rgPageLast,.RadGrid .rgPageFirst
           {
               display:none !important;
           }
       </style>



    Thanks,
    Jayesh Goyani
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. javier
    javier avatar
    48 posts
    Member since:
    Aug 2012

    Posted 03 Sep 2012 Link to this post

    Thank you Jayesh, it worked.
  5. TB
    TB avatar
    23 posts
    Member since:
    Jun 2010

    Posted 08 Nov 2013 Link to this post

    Where to insert to css snipet to work? Please I would like to know.

    PT. Nevermind. Found the answer.
  6. Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 08 Nov 2013 Link to this post

    Hello,

    If you want to hide this only in one page then you have to set this style into your aspx page.

    if you want to hide this from whole application then create one CSS file and place this style in it and give this css file link in to your page.

    Let me know if any concern.

    Thanks,
    Jayesh Goyani
  7. Arun
    Arun avatar
    1 posts
    Member since:
    Feb 2016

    Posted 12 Feb Link to this post

    This Css Is Working Fine suppose if i want to Hide  Those Buttons Only when the Radgrid Bindlist Count is <50 so how can i do it can i do it in Prerender Event ?
  8. Eyup
    Admin
    Eyup avatar
    3011 posts

    Posted 17 Feb Link to this post

    Hi Arun,

    You can use the following approach to access the row count:
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridPagerItem)
        {
            GridPagerItem pager = (GridPagerItem)e.Item;
            if (pager.Paging.DataSourceCount > 50)
            {
                pager.OwnerTableView.PagerStyle.Mode = GridPagerMode.NumericPages;
            }
        }
    }

    Regards,
    Eyup
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017