We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Relation between collection object and data table

Hi,

I am generating manual relation in grid grouping control. I have parent object as entity collection and child object as DataTable.
I am getting child table inserted below the parent but child table is coming blank..no values.
I have child table values present as per mapping key....
Please help me to solve this problem...
I am not getting why child table is not showing any values....




1 Reply

AD Administrator Syncfusion Team February 5, 2007 10:03 PM UTC

Hi,

Please double check your GridRelationDescriptor.ChildTableName property is same as SourceListSetEntry.Name for childTable. see the below code snippet for more details.

GridRelationDescriptor parentToChildRelationDescriptor = new GridRelationDescriptor();
parentToChildRelationDescriptor.ChildTableName = "MyChildTable"; // same as SourceListSetEntry.Name for childTable.
parentToChildRelationDescriptor.RelationKind = RelationKind.RelatedMasterDetails;
parentToChildRelationDescriptor.RelationKeys.Add("parentID", "ParentID");

// Register any DataTable/IList with SourceListSet, so that RelationDescriptor can resolve the name
this.gridGroupingControl1.Engine.SourceListSet.Add("MyParentTable", parentTable);
this.gridGroupingControl1.Engine.SourceListSet.Add("MyChildTable", childTable); //Here MyChildTable is the SourceListSetEntry.Name for childTable

Sample : RelatedMasterDetails.zip

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon