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

Is it possible to disable insert button in PreRender event ?

1 Answer 221 Views
Grid
This is a migrated thread and some comments may be shown as answers.
ericc34
Top achievements
Rank 1
ericc34 asked on 17 Jul 2008, 03:40 PM
Is it possible to disable insert button in PreRender event ?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 18 Jul 2008, 04:47 AM
Hello,

Check out the code snippet below to disable the CommandItemButtons.

CS:
protected void RadGrid1_PreRender(object sender, EventArgs e) 
    { 
        foreach (GridCommandItem cmditem1 in RadGrid1.MasterTableView.GetItems(GridItemType.CommandItem)) 
        { 
            //To disable the image 
            Button btn1 = (Button)cmditem1.FindControl("AddNewRecordButton"); 
            btn1.Enabled = false
            //To disable the LinkButton 
            LinkButton lnkbtn1 = (LinkButton)cmditem1.FindControl("InitInsertButton"); 
            lnkbtn1.Enabled = false;  
        }        
    } 

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