To be more precise:
I have object that has properties 'a' 'b' 'c' 'd' and so on (and the names are dynamic and also the types can change).
I have templates for different types. And if I have to list the properties of a single element I can just bind to the value in xaml and use datatemplateselector (in datagridtemplatecolumn) which will pick the correct template.
However, when I'm listing several of the elements, how can I use the selectors and the templates? How do I get the correct property to the template?
I'm stuck at:
foreach (String a in commonPropertyNames)
DataGridTemplateColumn templColumn = new DataGridTemplateColumn();
templColumn.IsReadOnly = false;
templColumn.CellEditingTemplateSelector =multiExpanderDG._dataGrid.FindResource("myDataTemplateEditorSelector") as DataTemplateSelector;
templColumn.CellTemplateSelector =multiExpanderDG._dataGrid.FindResource("myDataTemplateSelector") as DataTemplateSelector;
// How do I bind the data to it...? I can't do it with the binding like in the previous post