Datagrid binding to hash table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a hash table and want to bind it to a datagrid. Anyone know how to do
this without interating throught each key value pair?
 
Rob,

The Hashtable class does not implement the IList interface, which is
required for data binding. In order to get around this, you should provide
an implementation of IList on the Hashtable, which will return the
DictionaryEntry structures for each item in the list. This will cause the
key/value pairs to be shown in the data grid.

Hope this helps.
 
Thanks Nicholas

I think I'll run through the file and split values as the rows are being
read into a datatable.

Cheers.

Nicholas Paldino said:
Rob,

The Hashtable class does not implement the IList interface, which is
required for data binding. In order to get around this, you should provide
an implementation of IList on the Hashtable, which will return the
DictionaryEntry structures for each item in the list. This will cause the
key/value pairs to be shown in the data grid.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Rob Lykens said:
I have a hash table and want to bind it to a datagrid. Anyone know how to
do
this without interating throught each key value pair?
 

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

Back
Top