I looked around for this, but all the examples I could find used XAML, which made the solution too static. Here is what I want to do:
I would like to populate a DataGrid's columns, rows and attributes from an XML file to be specified at run time. Nothing about the DataGrid's attributes can be fixed; the XML drives it down to the last detail (hence why the XAML examples I saw aren't sufficient).
The details of the XML file are open, so any layout will do, but as an example:
<data>
<row Column="Col 1" Value="100" />
<row Column="Col 2" Value ="200" />
</data>
Would yield a grid of 2 columns named Column & Value respectively with the values ("Col 1", 100) & ("Col 2", 200) for the row 1 & 2, respectively.
Again, I have no problem with radically different XML, so I'll take what works.
Something like this seems very useful as it would allow the creation of generic data viewing components in a variety of domains. XML would offer a convenient generic format for transmitting structured data and the DataGrid would offer a rich viewing experience.