Here is an Example of a Detail Class you should create to get the detail items (I dont like autoCreate)
public class PartsDetail : DataGridDetailDescription
{
public PartsDetail()
{
RelationName = "Parts";
Title = "Parts to cut";
ItemProperties.Add(new DataGridItemProperty("quan", typeof(int)));
ItemProperties.Add(new DataGridItemProperty("Job", "Job", typeof(string)));
ItemProperties.Add(new DataGridItemProperty("Mark", "mark", typeof(string)));
ItemProperties.Add(new DataGridItemProperty("Cut", "cut", typeof(bool)));
ItemProperties.Add(new DataGridItemProperty("Locked", "locked", typeof(bool)));
ItemProperties.Add(new DataGridItemProperty("Dont Cut", "DontCut", typeof(bool)));
ItemProperties.Add(new DataGridItemProperty("length", typeof(int)));
Xceed.Wpf.DataGrid.Stats.SumFunction totQ = new Xceed.Wpf.DataGrid.Stats.SumFunction("totQuan", "quan");
LengthSumStatFunction totL = new LengthSumStatFunction("totLength", "length");
this.StatFunctions.Add(totQ);
this.StatFunctions.Add(totL);
}
protected override System.Collections.IEnumerable GetDetailsForParentItem(DataGridCollectionViewBase parentCollectionView, object parentItem)
{
Material mat = parentItem as Material;
if (mat != null)
{
//Here is Where you get the Detail Items for object parentItem.This is on Demand so this only runs when the Details are expanded
DataGridCollectionView view = new DataGridCollectionView(mat.Parts);
return new DataGridCollectionView(view);
//another possible way to set this up is to use Linq to Datasets and retrieve the ID of the parentItem then query a dataset for children?
}
return new Part[0];
}
}
//Just so you know the Sum Function never worked and I am still figuring out how to get Stat Functions Working