IsEnabled Property on Object Databinding

3 posts, 1 answers
  1. Rich Reuter
    Rich Reuter avatar
    14 posts
    Member since:
    Aug 2012

    Posted 29 Mar 2013 Link to this post

    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. Answer
    Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 01 Apr 2013 Link to this post

    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.

  3. DevCraft banner
  4. Rich Reuter
    Rich Reuter avatar
    14 posts
    Member since:
    Aug 2012

    Posted 01 Apr 2013 Link to this post

    That was exactly what I needed. Thanks for your help.
Back to Top