Object Collection Editor

AlexCode

Senior Contributor
Joined
Jul 7, 2003
Messages
931
Location
Portugal
Hi...

I have a little Design-time collections property grid display question...

I have a class that inherits from CollectionBase.
This class is part of a UserControl, returned from a Public Property.

How do I make it appear on the Property Grid, at design time, so I can edit it's items on the Object Collection Editor?

Note1: all the items on this collection have the same type.
Note2: I can make it a TypedCollection but then I will loose, for example, the Add & AddRange methods.

Thanks.

Alex :p
 
lol believe me this is quite non-trivial to do, it's easy to show it in the property grid it's just a simple attribute, not at home don't have the IDE in front of me, i think it's DesignTimeSerialization? someone will correct me, but that will only enavle you to show it in the property grid, it will probably add the items correctly but the hardest things are using TypeConverters to get the code generators generating code for the item in the collection.
 
Ok... Or there's something deeper than that or that tis just the top of it...
That will work only if the collection is typed, in other words, something like a String array, for example.
On the other hand, if the collection is an ArrayList, the collection editor doesn't know what type to add...

Alex :p
 
Back
Top