|
-
May 9th, 2003, 02:14 PM
#1
Thread Starter
Junior Member
Hashtable & Combo Box
Hi,
I've created a hashtable which contains a list of countries with the key being the ISO country code and the value being the country name.
In ASP.NET I've attached it to a drop down list as so:
ddlCountries.DataSource = myHashtable
ddlCountries.DataTextField = "Value"
ddlCountries.DataValueField = "Key"
This works absolutely fine.
Now when I try to do a similar thing in a Windows Form using a combo box it throws an exception:
"System Exception: Complex DataBinding accepts as a data source either an IList or an IListSource"
I guess that its down to the type of collection, but is there anyway of binding a hashtable to a combo box?
Or, is there any easy way to convert the hashtable to something the combo box WILL accept?
Any help would be appreciated.
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|