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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Add relation using multiple key pairs

Thread ID:





118125 Feb 3,2015 12:47 PM UTC Feb 4,2015 06:27 PM UTC WinForms 1
Tags: GridGroupingControl
Asked On February 3, 2015 12:47 PM UTC

I want to create Parent-Child relationship using multiple key pairs.
I have 2 tables as parent and child table.
Is there any possibility to add 4 relation keys (2 from parent table and 2 from child table) in a single relation descriptor?

Thanks and regards,

Muthukumar Kalyanasundaram [Syncfusion]
Replied On February 4, 2015 06:27 PM UTC

Hi Rasika,


Thank you for your interest in Syncfusion products.


If you want to create Parent-Child relationship using multiple key pairs in GridGroupingControl, you can add a multiple child table to single parent table (parent-child relation). In grid, at a time single datasource can be  can referred. Please refer the code,



DataTable parentTable = GetParentTable();

DataTable childTable1 = GetChildTable1();

DataTable childTable2 = GetChildTable2();


GridRelationDescriptor parentToChildRelationDescriptor = new GridRelationDescriptor();

parentToChildRelationDescriptor.ChildTableName = "MyChildTable1";

parentToChildRelationDescriptor.RelationKind = RelationKind.RelatedMasterDetails;

parentToChildRelationDescriptor.RelationKeys.Add("parentID", "ParentID");


GridRelationDescriptor ptc = new GridRelationDescriptor();

ptc.ChildTableName = "MyChildTable2";

ptc.RelationKind = RelationKind.RelatedMasterDetails;

ptc.RelationKeys.Add("parentID", "ParentID");


// Add relation to ParentTable




// 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("MyChildTable1", childTable1);

this.gridGroupingControl1.Engine.SourceListSet.Add("MyChildTable2", childTable2);


this.gridGroupingControl1.DataSource = parentTable;


Please let us know if you have any concern.



Muthukumar k

Attachment: Related_Master_Details_Demo_79b7639a.zip


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon