How can all PropertyDefinition groups Collapse/Expand by XAML code or MVVM pattern ?

5 posts, 0 answers
  1. Elena
    Elena avatar
    5 posts
    Member since:
    Feb 2015

    Posted 23 Mar 2015 Link to this post

    Hello, 
    How can all PropertyDefinition groups Collapse/Expand by XAML code or MVVM pattern ? I've tried IsExpanded property set to False but not work.


    <telerik:RadPropertyGrid x:Name="propertyGrid1" AutoGenerateBindingPaths="False"
                             Grid.Column="2"
                             Item="{Binding}"
                             LabelColumnWidth="180"
                             AutoGeneratePropertyDefinitions="False" IsGrouped="True">
        <telerik:RadPropertyGrid.PropertyDefinitions>
            <telerik:PropertyDefinition Binding="{Binding bind}" OrderIndex="0" IsExpanded="False"
                                        GroupName="Group1"
                                        DisplayName="Enable"/>
            <telerik:PropertyDefinition GroupName="Group1" OrderIndex="1"
                                        DisplayName="DisplayName1"/>
            <telerik:PropertyDefinition GroupName="Group2" OrderIndex="2"
                                        DisplayName="DisplayName2"/>
            <telerik:PropertyDefinition GroupName="Group3" OrderIndex="3"
                                        DisplayName="DisplayName3" />                       
        </telerik:RadPropertyGrid.PropertyDefinitions>
    </telerik:RadPropertyGrid>
  2. Elena
    Elena avatar
    5 posts
    Member since:
    Feb 2015

    Posted 23 Mar 2015 in reply to Elena Link to this post

    Sorry, Please this post transferred to the WPF section.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 24 Mar 2015 Link to this post

    Hello Elena,

    You can work with CollapseAllGroups() method of RadPropertyGrid (you need to set RenderMode property to "Flat" as well). 
    Do you want to perform this on a button click, on loading of the control or on another action ? 

    Regards,
    Maya
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  5. Elena
    Elena avatar
    5 posts
    Member since:
    Feb 2015

    Posted 24 Mar 2015 in reply to Maya Link to this post

    Hello Maya,

    Is possible Collapse all group by XAML side ?
  6. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 25 Mar 2015 Link to this post

    Hello Elena,

    Currently, this cannot be achieved only through xaml. What you can try instead is to create a custom attached behavior and call CollapseAllGroups() method in Loaded event of RadPropertyGrid. 
    In that way you will have code only in xaml and none in the code behind.
    A similar example can be found in the "Header Context Menu" demo of RadGridView. 


    Regards,
    Maya
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top
UI for WPF is Visual Studio 2017 Ready