This project is read-only.

Datagrid Column header more generic ItemsSource

Topics: User Forum
May 20, 2009 at 8:49 PM

Hi all, I am using the WPF toolkit DataGrid to display data from quite a large number of tests, 33 at last count.

Here is the problem I am having.  I have been creating objects with public properties as the items source to display my data.  However the data actually resides in xml files.  I deserialize them into my objects in order to create the datagrid.  The problem is that I have nested data within my data that I do not know the names for the column headers of until I actually read the data, e.g. at runtime.  This makes it imposible for me to create a specific object in order to create the necessary item source for display.

Is there an easy way to make this more generic so that I could generate a table based on say, something such as a List of System.Collections.Generic.Dictionary where the Key of the KeyValuePair is the DataGrid Column Header and the Value is the data for that column and each List item is a datagrid record?

Thanks,

-j