I am exporting a GridView that contains 2 child templates. However, I am not using the ExportToExcelML to perform the export. I am using Interop.Excel.
The two child templates are displayed at the same hierarchical level. Currently, I am using "foreach" to step through each row in the parent template and write its data to the Excel sheet.
I'm having trouble stepping through the related rows in each child template once I have the GridViewRowInfo of the parent row inside the "foreach". I can't seem to find an efficient way to access the rows of each template that directly relate to the current parent row. The ChildRows collection only seems to contain the rows of the first template.
Is there a built-in method or an elogant approach I could use to step through the child rows of each child template?
My current setup is as follows:
//Write parent row data to Excel sheet
//Access each child template either with a loop or explicitly
//Step through child template's rows and write the row data to the Excel sheet