• After more than 30 years running websites and forums I am retiring.

    I have made many friends through the years. I will cherish my time getting to know you. I wish you all the best. This was not an easy decision to make. The cost to keep the communities running has gotten to the point where it's just too expensive. Security certificates, hosting cost, software renewals and everything else has increased threefold. While costs are up ad revenue is down. It's no longer viable to keep things running.

    All sites will be turned off on Thursday 30 November 2023. If you are interested in acquiring any of the websites I own you can Email Schwarz Network.

Can't inherit from CollectionEditor

rbulph

Junior Contributor
Joined
Feb 17, 2003
I want to use the PropertyGrid with a collection of my own types of objects. I want to give the user the option to choose from a number of pre-existing objects which he can add to the collection through the Collection Editor.

I believe that the first thing I need to do is create a class inheriting from the CollectionEditor. But I can't seem to inherit from this. It's System.ComponentModel.Design.CollectionEditor right? It shows up in the Object Browser but doesn't seem to be recognised when I'm writing code at all. I'm probably missing something obvious, but any thoughts as to why this might be?

Thanks.
 

rbulph

Junior Contributor
Joined
Feb 17, 2003
OK, seems I can fix it by adding a project reference to System.Design.dll

But I'm confused. CollectionEditor is under the Namespace System.ComponentModel.Design, which presumably is within System.Design.dll. If I don't have a reference to System.Design.dll I can still refer to various System.ComponentModel.Design classes (like DesignerOptionService). What's the logic behind this?
 

rbulph

Junior Contributor
Joined
Feb 17, 2003
Thanks, I guess that must be right.

Would still be grateful for any direction as to how I can use the CollectionEditor to allow inclusion of items from a pre-existing collection rather than simply creating new ones.
 

rbulph

Junior Contributor
Joined
Feb 17, 2003
Hmm, perhaps it would be easier to create my own form and inherit UITypeEditor in a class to handle this.
 
Top Bottom