Edit this page

Enable / Disable items state

You can control the IsEnabled state of the RadToolBar items thus modifying the overall look of the control:

RadToolBar with enabled items:
Rad Tool Bar Enabled Items

RadToolBar with disabled items:
Rad Tool Bar Disabled Items

You can disable an item placed inside the RadToolBar by changing its IsEnabled property:

<telerik:RadToolBar x:Name="toolbar">
    <Button IsEnabled="False">
        <Image Source="/Images/Open.png" />

If you want to disable all RadToolBar items in code behind, you can traverse the Items collection of the control and change the enable state of each item:

foreach (object o in toolbar.Items)
    Control control = o as Control;
    if (control != null)
        control.IsEnabled = false;
For Each o As Object In toolbar.Items
    Dim control As Control = TryCast(o, Control)
    If control IsNot Nothing Then
        control.IsEnabled = False
    End If

The TextBlock control inherits the FrameworkElement, but not the Control, i.e. it has not the IsEnabled property. This is the reason that it can not be enabled and disabled.

Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article