Auto expand all child elements in Property Grid?

Grids for WPF Forum

Posted 8 years ago by Hardgrafter83
Version: 16.1.0630

I am trying to expand the child elements in a property grid. I've tried setting:

IsExpandedByDefault = true,
PropertyExpandability = PropertyGridPropertyExpandability.ForceAlways

in the ctor of the view Model with no success. Is there a way to auto expand all children within the grid without writing an implicit style in the PropertyGrid xaml?

I need a property available from each individual View Model to set this to expand or not.


[Modified 8 years ago]

Comments (2)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA


Unfortunately there isn't a way to set that at this time.  Without using the implicit style, you'd need to walk the visual tree looking for PropertyGridDataAccessorItem objects and set the IsExpanded property on those.  You could probably achieve that with a custom attached property.  We'll write down your request for an easier way.

Actipro Software Support

Answer - Posted 8 years ago by Hardgrafter83

Ok, I ended up creating an implicit style to solve this. A Setter with IsExpanded property on the PropertyGridDataAccessorItem type. I then do a relative source binding from the style file back to my viewModel. Thanks

The latest build of this product (v24.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.