PropertyDefinition IsExpanded binding have no effect

2 posts, 0 answers
  1. rui
    rui avatar
    55 posts
    Member since:
    May 2014

    Posted 21 Jul 2015 Link to this post

    I use a checkbox PropertyDefinition  which contains NestedProperties,  I want to achieve the checkbox and the expand keep the same status, when the checkbox is checked the nestedProperties expand and when the checkbox is unchecked the nestedProperties unexpand    the code is as follow

                                                Binding="{Binding ​IsShowDetail}"
                                                IsExpanded="{Binding ​IsShowDetail}">
                            <telerik:PropertyDefinition Binding="{Binding Path=Name,
                            <telerik:PropertyDefinition Binding="{Binding Path=Description,

     The "IsShowDetail " is a bool property,  the "Binging "and "IsExpanded "both binding to this property

    but the "IsExpanded "have no effect

    what is the reason for this and how to achieve this effect?


  2. Ivan Ivanov
    Ivan Ivanov avatar
    1201 posts

    Posted 24 Jul 2015 Link to this post


    PropertyDefinition derives from DependencyObject. Thus it supports data binding, but it does not have a default binding source (DataContext). So that you have to defined the source for the IsExpanded binding explicitly. You can expose the assigned Item/ViewModel instance as a StaticResource and refer to it in the binding definition.
    The "Binding" property works with data bindinng without specifying explicit source, because it gets assigned to the respective editor control, which generally derives from FrameworkElement and FrameworkElelement supports DataContext. RadPropertyGrid internally assigns the Item as a DataContext for its editors.

    Ivan Ivanov
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top