How to create collction property in my customer TypeDescriptorFactory

Grids for WPF Forum

Posted 6 years ago by Li Xiang
Version: 17.2.0662


I have a object has a collection property with type ObservableCollection<MyClass>,  and I have definded my own TypeDescriptorFactory, and override GetProperties() in it.  I want to create the collection  property and its items as the collction property's sub property, and also the item's property displayed in PropertyGrid. I had tried to override CreateCollectionPropertyModel() to create the property, but I found the item's properties were not displayed, and the TypeConverter didn't work, so I am wondering how to create the collction property in my customer TypeDescriptorFactory

Thank you

Comments (2)

Posted 6 years ago by Li Xiang

My current version is 17.1.650.0

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


This sort of thing can get complex so if any more replies are needed, we'd probably need you to make a new simple sample project that shows the issue and send that to our support address.  In your email, please reference this thread, remove the bin/obj folders from the ZIP you send, and rename the .zip file extension so it doesn't get spam blocked.

That being said, our TypeDescriptorFactory will look at each property descriptor.  If the PropertyGrid.CollectionPropertyDisplayMode is not set to Default and the return type is a valid generic collection (it should be in your case), then it will call into the CreateCollectionPropertyModel method.  Are you sure you set the CollectionPropertyDisplayModel property to a non-Default value?

Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.