问题
I like to display my data objects:
class DataElement
{
public string name { get; set; }
public List<customProperty> properties { get; set; }
}
class customProperty
{
public String value;
public String definition;
}
in a datagrid like:
Name | dataElementList[0].properties[0].definiton | dataElementList[0].properties[1].definiton | dataElementList[0].properties[2].definiton | ...
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
dataElementList[0].Name | dataElementList[0].properties[0].value | dataElementList[0].properties[1].value | dataElementList[0].properties[2].value | ...
dataElementList[1].Name | dataElementList[1].properties[0].value | dataElementList[1].properties[1].value | dataElementList[1].properties[2].value | ...
....
The property definition are the same for all elements. How can i bind my data structures to a datagrid with CellTemplates?
来源:https://stackoverflow.com/questions/39719910/bind-objects-with-generic-list-to-wpf-datagrid