Question

PropertyGrid ExpandableCollectionConverter DisplayName

Posted 5 months ago by Avatar Neil Larson

The ExpandableCollectionConverter.ListItemPropertyDescriptor.DisplayName is based on property of the object (for example - MyGridDisplayName) in the collection, and I want to bind the ExpandableCollectionConverter.ListItemPropertyDescriptor.DisplayName to theMyGridDisplayName on the object, or somehow update DisplayName after the object is edited.

Lots of possible ways to go, but I'm hoping you can point me at the best way to do this.

Thanks, 

Neil


Comments (1)

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

Hi Neil,

That can be a tad tricky, so please bear with me.  You effectively need to override the ExpandableCollectionConverter+ListItemPropertyDescriptor.DisplayName property, so you have to make a class that inherits ListItemPropertyDescriptor, then overrides the property with some appropriate value.

Next create a class that inherits ExpandableCollectionConverter and override the CreateListItemPropertyDescriptor method.  Have it return an instance of your MyListItemPropertyDescriptor class.

Finally use TypeConverterAttribute to put an instance of MyExpandableCollectionConverter on your collection property.  I think doing those steps will allow you to customize it.


Actipro Software Support
Information The latest build of this product (2018.1 build 0670) was released 7 days ago, which was after the last post in this thread.

Add a Comment

Please log in to a validated account to post comments.