databind hashtable

R

Ryan Moore

I am trying to use a hashtable as the datasource for a listbox and am
running into an error:

{"Complex DataBinding accepts as a data source either an IList or an
IListSource" }

what am I doing wrong? do I need to cast the hashtable in order to bind it?

thnx
 
N

Nicholas Paldino [.NET/C# MVP]

Ryan,

Just as it says, the Hashtable doesn't implement the IList interface.
However, you can get the collections of keys as well as the collection of
values and those implement IList (arrays are returned), and then you can
bind to those.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top