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

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

4 Answers 220 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sathya
Top achievements
Rank 1
Sathya asked on 05 Sep 2008, 07:43 AM

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...

4 Answers, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 05 Sep 2008, 07:55 AM
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.
0
Shinu
Top achievements
Rank 2
answered on 05 Sep 2008, 09:11 AM
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.
0
Alain
Top achievements
Rank 2
answered on 04 Feb 2012, 05:35 PM
Hello,

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

Any replacement ?

Thank you

Alain

0
Tsvetoslav
Telerik team
answered on 07 Feb 2012, 04:13 PM
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 >>
Tags
Grid
Asked by
Sathya
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Shinu
Top achievements
Rank 2
Alain
Top achievements
Rank 2
Tsvetoslav
Telerik team
Share this question
or