Hi Rasika,
Thank you for your interest in Syncfusion products.
We would like to let you that at first you can added all table to the dataSet, then
relations between the tables are made and added to the dataSet. The dataSet is
then assigned as the datasource of the grid. The GridGroupingControl itself
creates the nested structure of the tables directly from the information in the
dataset. Please refer the below code,
Code:
DataTable parentTable = GetParentTable();
DataTable childTable = GetChildTable();
DataTable grandChildTable = GetGrandChildTable();
DataSet ds = new
DataSet();
ds.Tables.AddRange(new DataTable[] {
parentTable, childTable, grandChildTable });
DataRelation parentToChild = new
DataRelation("ParentToChild",
parentTable.Columns["parentID"],
childTable.Columns["ParentID"]);
DataRelation childToGrandChild = new DataRelation("ChildToGrandChild", childTable.Columns["childID"], grandChildTable.Columns["ChildID"]);
ds.Relations.AddRange(new DataRelation[]
{ parentToChild, childToGrandChild });
this.gridGroupingControl1.DataSource =
parentTable;
Please let us know if you have any
concern.
Regards,
Muthukumar K
Attachment:
Parent__Child_relation_61025470.zip