RelationDescriptor AddRelation(string name, RelationDescriptorCollection relations) { RelationDescriptor children = new RelationDescriptor(); children.RelationKind = RelationKind.UniformChildList; children.MappingName = "Children"; children.Name = name; relations.Add(children); return(children); }
public Class1() { engine1 = new Engine(); CustomerCollection customers = PopulateCustomers.CreateCustomers(); this.engine1.SetSourceList(customers); RelationDescriptorCollection relations = new RelationDescriptorCollection(); // First level RelationDescriptor rd = AddRelation("Level_0", relations); // Subsequent levels for (int level = 1; level < 5; level++) { rd = AddRelation("Level_" + level.ToString(), rd.ChildTableDescriptor.Relations); } this.engine1.TableDescriptor.Relations.InitializeFrom(relations); this.engine1.Table.ExpandAllRecords(); }