Jump to content
Xtreme .Net Talk

Recommended Posts

  • *Experts*
Posted

I have a usercontrol and one of it's members is a type safe collection (inherited from CollectionBase.DictionaryBase).

 

Now I want this collection to be bindable (read-only) to a datagrid. I have added the attribute <Bindable()> to the property and implemented IListSource in the control and returned this list from GetList() overloaded function but it doesn't show up in the datagrid's bindings.

 

What step(s) am I missing?

 

Thanks in advance,

Duncan

Printer Monitor for .NET? - see Merrion Computing Ltd for details
  • *Experts*
Posted
OK - I was on the wrong track with IListSource - It should have been IBindableList...now the Datagrid binds to the list but it doesn't know anything about the data type within the collection - how do I do that part?
Printer Monitor for .NET? - see Merrion Computing Ltd for details
  • Leaders
Posted

Implement the Add Sub, Create Method, and Item Property with you're datatype in mind. So, for the Item property, you'll do something like this:

Default Property Item(ByVal key As String) As MySpecificDataType
 Get
     Return CType(Dictionary.Item(key), MySpecificDataType)
 End Get
 Set(ByVal Value as MySpecificDataType)
     Dictionary.Item(key) = Value
  End Set
End Property

--tim

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