Category Item related issue

Grids for WPF Forum

Posted 10 years ago by Anurodh Ora
Version: 4.5.0486
Avatar
Hi,

How to set the category to be expanded or collased initially at run time.

I did not get any property in PropertyGridCategoryItem to set its Expand/Collapse
property.


Thanks

Anurodh

Comments (4)

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

Currently, there is no property on the "data layer" objects (such as PropertyGridCategoryItem), that allows you to specify whether they are expanded. We may add this type of feature in the future.

What you can do is apply an implicit style to the PropertyGridDataAccessorItem type to expand or collapse certain categories. You would need use one or more triggers based on the DataAccessorType being Category, and the DisplayName equals the category in question. Then you would set the IsExpanded property appropriately.

Additionally, you can disable the automatic expansion of all categories by setting PropertyGrid.AreCategoriesAutoExpanded to false.


Actipro Software Support

Posted 9 years ago by EXAKOM
Avatar
Hello,
Is it possible to have a small code example to download?
Thank you :)
Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Nicolas,

This post shows some code examples.

The first example assumes you have a custom IValueConverter that will take the DisplayName of the category and return either true (expanded) or false (collapsed). The second example actually binds the expanded state to a custom ICategoryDataAccessor. The first example is more applicable here, though.


Actipro Software Support

Posted 9 years ago by EXAKOM
Avatar
After posting my message earlier, I kept looking and I found this sample and manage to customize the expanded state of the categories.
Thanks :)
The latest build of this product (v2018.1 build 0675) was released 13 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.