Expose collection items into PropertyGrid

Grids for WPF Forum

Posted 5 years ago by David Garcia
Version: 18.1.0672
Avatar

Hi,

We are using the Actipro Property Grid... we have a viewmodel with an ObservableCollection and we want to hide the parent collection row and display only it´s children. As a remark, the items should be refreshed in any collection change. Which is the way to achieve this goal?

CURRENT STATE

* Misc                // Category

    + Identifier   // Prop

    + Names     // Collection Prop

           -[0]       // Inner Prop 1

           -[1]      // Inner Prop 2

NEW STATE

* Misc                // Category

    + Identifier   // Prop

    + [0]        // Inner Prop 1

    + [1]       // Inner Prop 2

Thanks in advance

Comments (1)

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

Hi David,

I'm not sure that is possible, at least using the built-in mechanisms.  The problem is that a property model is created for the collection and that is what watches for collection changes, so it knows when the refresh the children.  If you take that collection property model out of the UI, then you also lose the property models for the child items, since they are nested within that parent property model.

The PropertyGridCustomDataFactory QuickStart is an example of merging together property models so that properties from a couple hierarchy levels are altered in how they appear.  That is similar to the concept you’re trying to achieve, but without the collection scenario.  If you want to use that kind of mechanism, you’d have to watch for collection changes on your own and update the property models appropriately when appropriate.


Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.