In an ASP.net application, i was able to create a hashtable, and bind a dropdownlist to it:
C# Code:
DropDownList1.DataSource = myHashTable; DropDownList1.DataTextField = "Key"; DropDownList1.DataValueField = "Value"; DropDownList1.DataBind();
this worked successfully.
When I tried it in a winforms app, binding a listbox to a hashtable:
C# Code:
ListBox1.DataSource = myHashTable; ListBox1.DisplayMember = "Key"; ListBox1.ValueMember = "Value";
I got an error saying that complex databinding requires an implementation of IList or IListSource as a datasource.
What am i doing wrong?




Reply With Quote