rbulph Posted August 22, 2012 Posted August 22, 2012 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. Quote
rbulph Posted August 22, 2012 Author Posted August 22, 2012 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? Quote
Administrators PlausiblyDamp Posted August 22, 2012 Administrators Posted August 22, 2012 There isn't a one to one mapping between namespaces and dlls, it looks as though the System.ComponentModel.Design namespace is split between those two dlls. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
rbulph Posted August 23, 2012 Author Posted August 23, 2012 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. Quote
rbulph Posted August 23, 2012 Author Posted August 23, 2012 Hmm, perhaps it would be easier to create my own form and inherit UITypeEditor in a class to handle this. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.