Self Referential Grid Demo

This sample demonstrates how to manually specify self relations in a table.

Features:

This is how the sample looks.

Manually specified self relations



The following code shows registering the data table with the source-list set so that the relation descriptor can resolve the name.

                 this.gridGroupingControl1.Engine.SourceListSet.Add("SelfReferencialTable", selfreferentialTable);  

The following code illustrates how to manually specify the self-relation without using the data table.

                GridRelationDescriptor parentToChildRelationDescriptor = new GridRelationDescriptor();
            parentToChildRelationDescriptor.ChildTableName = "SelfReferencialTable";    // same as SourceListSetEntry.Name for childTable (see below)
            parentToChildRelationDescriptor.RelationKind = RelationKind.RelatedMasterDetails;
                        //Relations specified within different columns of the same table.
            parentToChildRelationDescriptor.RelationKeys.Add("ID", "RelatedTo");

           

                 // Add relation to ParentTable 
            parentgridTableDescriptor.Relations.Add(parentToChildRelationDescriptor);