Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Software bugs are impossible to detect by anybody except the end user.
Posted
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.
Posted

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

Software bugs are impossible to detect by anybody except the end user.

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...