/// <summary> /// binding Custom collection to the GridGroupingControl. /// </summary> private void SampleCustomization() { CustomerCollection customers = PopulateCustomers.CreateCustomers(); this.groupingGrid1.DataSource = customers; GridEngine engine = this.groupingGrid1.Engine; engine.TopLevelGroupOptions.ShowCaption = true; GridRelationDescriptorCollection relations = new GridRelationDescriptorCollection(); // First level GridRelationDescriptor rd = AddRelation("Level_0", relations); // Subsequent levels for (int level = 1; level < 5; level++) { rd = AddRelation("Level_" + level.ToString(), rd.ChildTableDescriptor.Relations); } this.groupingGrid1.TableDescriptor.Relations = relations; Syncfusion.Grouping.Diagnostics.IterateThroughNestedDisplayElement(this.groupingGrid1.Table); }
//Adding relation to the child columns. GridRelationDescriptor AddRelation(string name, GridRelationDescriptorCollection relations) { GridRelationDescriptor children = new GridRelationDescriptor(); children.RelationKind = RelationKind.UniformChildList; children.MappingName = "Children"; children.Name = name; relations.Add(children); return(children); }