Binding a combobox to a generic.dictionary
Hi all, I am using vb.net and would like to bind a combobox to a generic dictionary object, called 'dicFriendData'. The object uses a string as it's key and a simple class, called FriendData, as the value. The relevant code is this:
I've gone through the visual design tools and attempted to create a data binder through the properties window DataBindings interface, but no matter how I set the SelectedItem and SelectedValue properties, I get no data. Anyone know how to make this work?
Public Class dicFriendData
Inherits Generic.Dictionary(Of String, FriendData)
Friend Shadows Sub Add(ByVal key As String, ByVal value As FriendData)
Friend Shadows Function Remove(ByVal key As String)
Remove = MyBase.Remove(key)
Public Class FriendData
Private _FID As String
Private _ProfileName As String
Private _IMG As Image
Public Sub New(ByVal FID As String, ByVal ProfileName As String, ByVal IMG As Image)
_FID = FID
_ProfileName = ProfileName
_IMG = IMG
Public ReadOnly Property DefaultImage() As Image
DefaultImage = _IMG
Public ReadOnly Property FriendID() As String
FriendID = _FID
Public ReadOnly Property Title() As String
Title = _ProfileName
I would appreciate help greatly!
n.b. I am not going through a database or utilizing a DB in any way, so all code I have found relating to this feature doesn't seem to help; however, the documentation, and not to mention the "Add Project DataSource" wizard, lead me to believe I can bind to an object that is not actually a DB. I've seen some brilliant and elegant solutions on this site, so I'm hoping someone can help me as well.