Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
470
Nested Grid
posted

I have a List of Class OrderSetItem which I apply to Grid.DataSource

public class OrderSetItem { public OrderSetItem(){} public string Description { getset; }

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(){}

  public string Description { get; set; }

  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?

 

Parents
No Data
Reply
  • 470
    Verified Answer
    Offline posted

    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.

Children
No Data