Multiple selection and nested items

Grids for WPF Forum

Posted 15 years ago by Nick Arkell
Version: 4.5.0480
Avatar
For single selection in the property grid I have overridden DataFactory.GetProperties(object, DataFactoryOptions) to produce a list of IPropertyDataAccessor object using reflection on my object model. For each single object selected, GetProperties() is called multiple times to recurse down the hierarchy of properties creating a property grid with a tree of expandable properties.

When multiple items are selected via setting PropertyGrid.SelectedObjects, GetProperties() is called once for each selected object, but not for the objects they contain as it does for single selection. The result is a property grid containing no expandable items (items that were expandable for single selection aren't anymore).

I have tried overriding DataFactory.GetProperties(object[], DataFactoryOptions) and creating MergedPropertyDataAccessor objects from groups of my previously created IPropertyDataAccessor, but the result is the same. The key seems to be how many times DataFactory.GetProperties() is called and for what.

How can I influence what calls are made to DataFactory.GetProperties() when multiple objects are selected so that I get all common properties in the proper hierarchy in the property grid?

Nick

Comments (2)

Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Nick,

This is actually a bug in our code for merged properties. The Values property should have been returning an array of the merged values (which would then be passed to the GetProperties method), but was incorrectly returning null.

I have fixed this for the next maintenance release.


Actipro Software Support

Posted 15 years ago by Nick Arkell
Avatar
That prooves it's not just me.

Thanks.
The latest build of this product (v24.1.1) 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.