Disable button

3 posts, 1 answers
  1. Gilbert van Veen
    Gilbert van Veen avatar
    68 posts
    Member since:
    Oct 2009

    Posted 15 Jan 2010 Link to this post

    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. Answer
    Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 15 Jan 2010 Link to this post

    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.
  3. DevCraft banner
  4. Gilbert van Veen
    Gilbert van Veen avatar
    68 posts
    Member since:
    Oct 2009

    Posted 15 Jan 2010 Link to this post

    Thanks Valentin.

    I missed that property.
Back to Top