Auto expand all child elements in Property Grid?

Grids for WPF Forum

Posted 3 years ago by Hardgrafter83
Version: 16.1.0630
Avatar

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.

Thanks

[Modified 3 years ago]

Comments (2)

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

Hello,

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 3 years ago by Hardgrafter83
Avatar

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 (v2018.1 build 0675) was released 7 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.