I have a List of Class OrderSetItem which I apply to Grid.DataSource
public class OrderSetItem { public OrderSetItem(){} public string Description { get; set; }
private List<COrder> children = new List<COrder>(); public List<COrder> Children {
get{return children;} set{ this.children = value;}
} }
COrder is defined as
public class COrder
{
public COrder(){}
public string Description { get; set; }
private CItem orderitem = null;
public CItem OrderItem {
get{return orderitem;}
set{ this.orderitem = value;}
}
and each CItem has Location which is a Class
public class Location{
public Location(){}
private int capacity = 0;
public string SiteText {
get{return siteText;}
set{ this.siteText = value;}
public int Capacity {
get{return capacity;}
set{ this.capacity = value;}
And I want to display all 3 Levels, but I can't see the orderitem or Location.
xaml is
<igDP:XamDataGrid.FieldLayouts > <igDP:FieldLayout Key="OrderSetItem"> <igDP:FieldLayout.Settings> <igDP:FieldLayoutSettings AutoFitMode="Always" AutoGenerateFields="False" /> </igDP:FieldLayout.Settings> <igDP:FieldLayout.Fields> <igDP:Field Name="Description" /> </igDP:FieldLayout.Fields> </igDP:FieldLayout> <igDP:FieldLayout Key="Children"> <igDP:FieldLayout.Settings><igDP:FieldLayoutSettings AutoFitMode="Always" AutoGenerateFields="False" /> </igDP:FieldLayout.Settings> <igDP:FieldLayout.Fields> <igDP:Field Name="Description" /> </igDP:FieldLayout.Fields> </igDP:FieldLayout> <igDP:FieldLayout Key="OrderItem" /> <igDP:FieldLayout.Settings><igDP:FieldLayoutSettings AutoFitMode="Always" AutoGenerateFields="False" /> </igDP:FieldLayout.Settings> <igDP:FieldLayout.Fields> <igDP:Field Name="Description" /> </igDP:FieldLayout.Fields></igDP:FieldLayout> <igDP:FieldLayout Key="Location" /><igDP:FieldLayout.Settings><igDP:FieldLayoutSettings AutoFitMode="Always" AutoGenerateFields="False" /></igDP:FieldLayout.Settings> <igDP:FieldLayout.Fields><igDP:Field Name="Capacity" /><igDP:Field Name="SiteText" /></igDP:FieldLayout.Fields></igDP:FieldLayout></igDP:XamDataGrid.FieldLayouts>
What do I have to do to get all levels?
Can any body provide a full working sample for this?
Found the answer by myself....
Nested rows can only be generated from List or an equivalent supplying an IEnumerator.
This means You have to encapsulate Properties You wana have nested in a List<T> and also have to declare this Field in the parent field layout.