What is the best approach to bind a WPF DataGrid ItemsSource to an ObservableCollection of ObservableCollections ?
e.g.
public ObservableCollection<ObservableCollection<MyDataItem>> DataValues = new ObservableCollection<ObservableCollection<MyDataItem>>();
where MyDataItem may look like this:
public class MyDataItem
{
public string Caption { get; set; }
public string DataValue { get; set; }
}
I can assume the collection of collections isn't jagged, and they all contain the same number of "columns"
Is it possible to bind each column dynamically to the 'DataValue' property of the MyDataItem objects or do I need to pack the data into an easier structure to bind to?