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

    CommandItemDisplay

    ="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
    Admin
    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,
    Stephen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. 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.

    CS:
      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
            } 
        } 


    Thanks
    Shinu.
  5. Alain
    Alain avatar
    6 posts
    Member since:
    Jan 2012

    Posted 04 Feb 2012 Link to this post

    Hello,

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

    Any replacement ?

    Thank you

    Alain

  6. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 07 Feb 2012 Link to this post

    Hi Sathya,

    Here are the help articles links:
    http://www.telerik.com/help/aspnet-ajax/grid-commanditemtemplate.html
    http://www.telerik.com/help/aspnet-ajax/grid-localizing-gridcommanditem.html

    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
UI for ASP.NET Ajax is Ready for VS 2017