Binding Hashtable to GridDataBoundGrid

Can I bind (datasource=) a Hasttable to a databoundgrid?
If so how? I tried and got the following exception:
BadDataSourceForComplexBinding

btw - I tried both the Hashtable as well as Hashtable.Values

1 Reply

AD Administrator Syncfusion Team October 27, 2006 08:40 AM UTC

Hi Allen,

The reason is that 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.

Best Regards,
Haneef

Loader.
Up arrow icon