Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi!

 

I have a user control and one of its properties is a Collection.

 

How do I manage this collection on the properties grid at design-time like I manage the tab pages of the tab control for example?

 

I need to view that collection editor with all properties of the collection objects, add and remove items to the collection... etc...

 

 

 

 

Thanks

 

 

Alex :D

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

Divil has a very useful tuturial about SOME designers...

But not the collection editor... :(

 

Still wondering around for it...

 

 

 

Thanx

 

Alex :D

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

Ok,

I think I'm quite close to get it but I'm still having problems editing the Items and adding them into the collection...

 

I have this:

 


Public Class winMultiPage

...

   Dim _PagesColl As ArrayList
   <Editor(GetType(MYCollectionEditor), GetType(System.Drawing.Design.UITypeEditor))> _
   Public Property PagesColl() As ArrayList
       Get
           Return _PagesColl
       End Get
       Set(ByVal Value As ArrayList)
           _PagesColl = Value
       End Set
   End Property

...

End Class

Friend Class MYCollectionEditor
   Inherits CollectionEditor

   Public Sub New()
       MyBase.New(GetType(winMultiPage))
   End Sub

   Protected Overrides Function CreateCollectionItemType() As System.Type
       Return GetType(winPage)
   End Function

End Class

 

 

What happens with this code is that when I add an item in the CollectionEditor the Add & Remove buttons become desabled, and a still can't add that item to the collection...

 

When I close the editor and reopen it again I don't get any object on the listbox but the PropertyGrid is filled with the properties like if an object was selected...

 

Wierd :confused:

 

 

 

Thanx

 

Alex :D

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