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

Disable button

2 Answers 68 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Gilbert van Veen
Top achievements
Rank 1
Gilbert van Veen asked on 15 Jan 2010, 11:06 AM
Hi,

I is it possible to enable/disable buttons in the toolbar from within code?

<telerikNavigation:RadToolBar x:Name="Mus_ToolBar" Margin="0" Grid.Row="0" Grid.Column="0" d:LayoutOverrides="Height">  
                        <Button Click="ToolBarClick" Tag="Mus_New">  
                            <Image Width="16" Height="16" Source="/Images/new.png" ToolTipService.ToolTip="New" /> 
                        </Button> 
 
                        <Button Click="ToolBarClick" Tag="Mus_Edit">  
                            <Image Width="16" Height="16" Source="/Images/edit.png" ToolTipService.ToolTip="Edit" /> 
                        </Button> 
 
                        <Button Click="ToolBarClick" Tag="Mus_Delete">  
                            <Image Width="16" Height="16" Source="/Images/delete.png" ToolTipService.ToolTip="Delete" /> 
                        </Button> 
 
                        <Button Click="ToolBarClick" Tag="Mus_Refresh">  
                            <Image Width="16" Height="16" Source="/Images/refresh.png" ToolTipService.ToolTip="Refresh" /> 
                        </Button> 
                    </telerikNavigation:RadToolBar> 

I would to enable the Edit and Delete buttons only if there is a row selected in a RadGrid. In the Grid_SelectionChanged I would like to change the buttons state.

2 Answers, 1 is accepted

Sort by
0
Accepted
Valentin.Stoychev
Telerik team
answered on 15 Jan 2010, 11:42 AM
Hi Gilbert van Veen,

You can use the IsEnabled property. Set it to False to disable the button.

Greetings,
Valentin.Stoychev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Gilbert van Veen
Top achievements
Rank 1
answered on 15 Jan 2010, 12:32 PM
Thanks Valentin.

I missed that property.
Tags
ToolBar
Asked by
Gilbert van Veen
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
Gilbert van Veen
Top achievements
Rank 1
Share this question
or