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

[Solved] How to remove Add New Record button-

3 Answers 381 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Stephen
Top achievements
Rank 1
Stephen asked on 28 Apr 2008, 06:14 PM
Hi,

I want to disable the Add New Record button and just leave the Edit and Insert buttons.  I have tried disabling AllowAutomaticDeletes but the button is still there in the header region.  I cant see anything declaratively which would allow me to hide this.

I am using the Outlook2007 skin and the add button appears above the headers.

Thanks in advance

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 29 Apr 2008, 07:53 AM
Hi Stephen,


Can you try setting CommandItemDisplay="None" in the aspx ?

Thanks
Shinu.


0
Stephen
Top achievements
Rank 1
answered on 29 Apr 2008, 02:31 PM
Thanks, it worked!
0
Princy
Top achievements
Rank 2
answered on 30 Apr 2008, 01:50 PM
Hi Stephen,

You can also try the following code snippet to hide the AddNewRecord button.

CS:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)  
    {  
        if (e.Item is GridCommandItem)  
        {  
            GridCommandItem cmditem = (GridCommandItem)e.Item;  
            LinkButton lnkbtn = (LinkButton)cmditem.FindControl("InitInsertButton");  
            lnkbtn.Visible = false;  
        }  
  } 

Thanks
Princy.
Tags
Grid
Asked by
Stephen
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Stephen
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or