expand categories

Grids for WPF Forum

Posted 10 years ago by Mary Fontana - Rudolph Technologies
Avatar
I am using AreCategoriesAutoExpanded=true. I have a request to auto expand all but the Misc category when displayed. I'd appreciate help on how to collapse the misc category when first displayed.

Comments (2)

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Mary,

You can include an implicit Style like so:
<Style TargetType="{x:Type propgrid:PropertyGridDataAccessorItem}">
    <Style.Triggers>
        <MultiDataTrigger>
            <MultiDataTrigger.Conditions>
                <Condition Binding="{Binding DataAccessorType, RelativeSource={RelativeSource Self}}" Value="Category" />
                <Condition Binding="{Binding DisplayName, RelativeSource={RelativeSource Self}}" Value="Misc" />
            </MultiDataTrigger.Conditions>
            <Setter Property="IsExpanded" Value="False" />
        </MultiDataTrigger>
    </Style.Triggers>
</Style>


Actipro Software Support

Posted 5 years ago by IneedHelp
Avatar

Could you please tell me how to achieve this in code behind?

My entire project is based on C# code. It's very hard to use documentation/forum examples when most of it is XAML.

Edit:  I found the solution in the SettingFocus\MainControl.xaml.cs sample file.  Thank you!

[Modified 5 years ago]

The latest build of this product (v21.1.1) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.