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

Disable RadToolBarButton in grid

1 Answer 41 Views
Grid
This is a migrated thread and some comments may be shown as answers.
hasan
Top achievements
Rank 1
hasan asked on 13 Jan 2009, 06:38 AM
Hello
How can i disable or hide one RadToolBarButton in CommandItemTemplat of grid
 when select row of grid??

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 1
answered on 13 Jan 2009, 07:14 AM
Hello Hasan,

You can try out the following code to disable a command item on selecting an item:
cs:
 protected void RadGrid1_SelectedIndexChanged(object sender, EventArgs e) 
    { 
       foreach (GridCommandItem cmdItem in RadGrid1.MasterTableView.GetItems(GridItemType.CommandItem)) 
         { 
            RadToolBar rdtlbr = (RadToolBar)cmdItem.FindControl("RadToolBar1"); 
            rdtlbr.FindItemByText("Update").Enabled = false
         }             
    } 

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