Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

Posted

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?

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...