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
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