Question

How to create collction property in my customer TypeDescriptorFactory

Posted 6 months ago by Avatar Li Xiang

Hi,

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 months ago by Li Xiang

My current version is 17.1.650.0

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

Hello,

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
Information The latest build of this product (2018.1 build 0670) was released 10 days ago, which was after the last post in this thread.

Add a Comment

Please log in to a validated account to post comments.