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

Iterating through the child tables of a parent table

hi, I''m looking for sample code to iterate through the the child tables of a parent table. If i have a parent table that has 4 child tables, i would like to know how you iterate through all the child tables. Regards David

1 Reply

AD Administrator Syncfusion Team August 25, 2005 11:05 AM UTC

I am not sure I understand what you mean by child tables. If you mean expanding a record and seeing multiple nested tables on the same level, then you can use the gridRecord.NestedTables collection to iterate through these child tables. If you mean a series of heirarchical parent child tables, then you can use gridRecord.ParentChildtable.NestedTable[0].ChildTable to get at the inner level. You would have to do this recursively to see nested child tables. //get a record GridRecord rec = this.gridGroupingControl1.Table.Records[0] as GridRecord; //show its child table Console.WriteLine( rec.NestedTables[0].ChildTable.Name); //show its grandchildtable Console.WriteLine(rec.NestedTables[0].ChildTable.Records[0].NestedTables[0].ChildTable.Name);

Loader.
Live Chat Icon For mobile
Up arrow icon