views:

135

answers:

1

I have many kinds of objects - the design is such that is not practical to create a subclass for every conceivable combination of attributes. Instead, I have a Hashtable called Attributes that holds the data for each one.

I'm trying to display the contents of Attributes in an XtraGridView/GridView. I'd like each of the key/value pairs to appear in a subview. Like so:

+-----------------------------------------+
| Attributes                              |
|     Key1            |  Value1           |
|     Key2            |  Value2           |
|     Key3            |  Value3           |
+-----------------------------------------+

Any way to do this?

A: 

You just have to specify the Hashtable as the GridView's DataSource.

http://forums.asp.net/t/1173224.aspx

Or you can always transform your data into a Datatable object and then pass THAT to the GridView's DataSource.

Sheep Slapper