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

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

4 Answers 197 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Elena
Top achievements
Rank 1
Elena asked on 23 Mar 2015, 08:28 AM
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>

4 Answers, 1 is accepted

Sort by
0
Elena
Top achievements
Rank 1
answered on 23 Mar 2015, 08:55 AM
Sorry, Please this post transferred to the WPF section.
0
Maya
Telerik team
answered on 24 Mar 2015, 11:46 AM
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.

 
0
Elena
Top achievements
Rank 1
answered on 24 Mar 2015, 03:25 PM
Hello Maya,

Is possible Collapse all group by XAML side ?
0
Maya
Telerik team
answered on 25 Mar 2015, 08:39 AM
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.

 
Tags
PropertyGrid
Asked by
Elena
Top achievements
Rank 1
Answers by
Elena
Top achievements
Rank 1
Maya
Telerik team
Share this question
or