Dont want Add New Record item in CommandItemDisplay property of Rad Grid

5 posts, 0 answers
  1. Sathya
    Sathya avatar
    8 posts
    Member since:
    Apr 2008

    Posted 05 Sep 2008 Link to this post


    ="Bottom" property adds the  "Add new record" and "Refresh" button by default.

    But my requirement is want to display only the Refresh button.
    The Add New Record Text and Image is not required.

    How can i accomplish this??

    Kindly help me...

  2. Sebastian
    Sebastian avatar
    9934 posts

    Posted 05 Sep 2008 Link to this post

    Hi Sathya,

    To hide a button from the default RadGrid command item, you can reference the respective button by its id (intercepting the ItemCreated event of the grid) and set its Visible property to false. Alternatively, define your own command item template as explained in this help article.

    Best regards,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 05 Sep 2008 Link to this post

    Hi Sathya,

    You can try the following code snippet to achieve the desired scenario.

      protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) 
            if (e.Item is GridCommandItem) 
                GridCommandItem cmditm = (GridCommandItem)e.Item; 
                Button btn1 = (Button)cmditm.FindControl("AddNewRecordButton"); 
                btn1.Visible = false
                LinkButton lnkbtn1 = (LinkButton)cmditm.FindControl("InitInsertButton"); 
                lnkbtn1.Visible = false

  4. Alain
    Alain avatar
    7 posts
    Member since:
    Jan 2012

    Posted 04 Feb 2012 Link to this post


    The help article link mentionned in this post is not working.

    Any replacement ?

    Thank you


  5. Tsvetoslav
    Tsvetoslav avatar
    1823 posts

    Posted 07 Feb 2012 Link to this post

    Hi Sathya,

    Here are the help articles links:

    Regards, Tsvetoslav
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Back to Top