PropertyGrid with objects of different types

Grids for WPF Forum

Posted 10 years ago by Yoni Leitersdorf
Version: 9.1.0501
Avatar
Hi,

I would like to use the same PropertyGrid for a number of objects, each of a different type but all inherit from the same base class. What would be the best way to do so, assuming some of the properties are shared across all the types and some are unique to specific types?

Thank you,
yoni

Comments (1)

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Yoni,

Our PropertyGrid has a SelectObjects (not to be confused with SelectedObject) property, which you can set to an array of objects. The PropertyGrid will then display properties that are common to all the objects in the array. If you make a change to a property, it is pushed to all the underlying objects.

A "common property" is simply defined as having the same name and Type. So even if your classes did not derive from the same base class, you could have common properties. For example, if each object defined a Name property of Type String, then the PropertyGrid would display it.

If you need more advanced functionality then you will probably need to build a custom data factory.


Actipro Software Support

The latest build of this product (v2019.1 build 0681) was released 9 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.