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

HOw do I disable inserts?

2 Answers 93 Views
Grid
This is a migrated thread and some comments may be shown as answers.
john
Top achievements
Rank 1
john asked on 21 Jul 2008, 06:43 PM
In the top left corner of my grid, there is a insert icon and text, I want to remove it.

thanks!

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 22 Jul 2008, 03:48 AM
Hello John,

Check out the following code to disable the InsertButton.

cs:
protected void RadGrid1_ItemDataBound(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
Princy.
0
john
Top achievements
Rank 1
answered on 22 Jul 2008, 05:37 AM
Hi Princy,
Thanks, but the insert link I was talking about is located in the very top left portion of the grid.....I can disable it by doing the following:

this.RadGrid1.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;

However, by doing it this way, the whole top bar disappears, so, I was looking for another way.



On a side note, have you ever noticed every once in a while when loading the grid control, that it may not load the entire way....if you click refresh in the browser, it clears it up, but was curious if there is a way to simply turn off the ajax on the radgrid control and require a page reload every time.

Also, I notice you are pretty good at this, you're always the same person helping us folks out.  If you are ever in need of a job, I may have some freelance work for you.  Feel free to email me at spam1 at whojohndavid.com and let me know your rate in US $ if you're interested.

Tags
Grid
Asked by
john
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
john
Top achievements
Rank 1
Share this question
or