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

IsEnabled Property on Object Databinding

2 Answers 70 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Rich Reuter
Top achievements
Rank 1
Rich Reuter asked on 29 Mar 2013, 06:39 PM
I have a scenario where I'm binding a custom list of custom objects to a RadPanelBar using a custom control template and a HierarchicalDataTemplate to style the elements of the RadPanelBar - specifically, I'm styling the colors, fonts and backgrounds.  None of the layout elements have significantly changed.

The issue that I'm having is that I want to disable some of the items in the list based upon the IsEnabled property that exists on my objects.  Originally, I was using a ListBox with the same ItemsSource and that worked fine.  Is there somewhere on the custom layout that I need to declare and bind IsEnabled?

2 Answers, 1 is accepted

Sort by
0
Accepted
Pavel R. Pavlov
Telerik team
answered on 01 Apr 2013, 02:47 PM
Hello Rich,

Yes, you have to bind your business property to the RadPanelBar's IsEnabled property. In order to do this you can create a Style targeting the RadPanelBarItem and apply the binding like this:

<Style TargetType="telerik:RadPanelBarItem">
 <Setter Property="IsEnabled" Value="{Binding MyCustomIsEnabledProperty}"/>
</Style>
Please give this approach a try and let us know if you need further assistance.

Kind regards,
Pavel R. Pavlov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Rich Reuter
Top achievements
Rank 1
answered on 01 Apr 2013, 06:28 PM
That was exactly what I needed. Thanks for your help.
Tags
PanelBar
Asked by
Rich Reuter
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Rich Reuter
Top achievements
Rank 1
Share this question
or