BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
ds.Tables.AddRange(new DataTable[]{parenttable,childtable})
method gives me the error of "Datatable 'Table1' is already belongs to this dataset".
Please give me any solution regarding to this.
Regards,
Rasika
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
Hi Rasika
We are glad to hear that the reported issue has been resolved. Please let us know if you need any further assistance.
Regards,
Muthukumar K