This is a migrated thread and some comments may be shown as answers.

Exporting GridView with Mutiple Child Templates using Interop.Excel

1 Answer 86 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Doug
Top achievements
Rank 1
Doug asked on 21 May 2012, 04:01 PM
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:
foreach (GridViewRowInfo row in gridView.Rows)
{
   //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
}

1 Answer, 1 is accepted

Sort by
0
Ivan Petrov
Telerik team
answered on 23 May 2012, 05:34 PM
Hello Doug,

Your question has already been answered in the other thread you have opened. Please, see our answer there for more information.

We would like to kindly ask you to use just one support channel to contact us. Posting the same question more than once slows down our response time because we will need to review and address two or more threads instead of one. Furthermore, please have in mind that support threads are handled according to the license type and time of posting, so if it is an urgent issue, we suggest that you use a support ticket, which would be handled before a forum thread.

Regards,
Ivan Petrov
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Tags
GridView
Asked by
Doug
Top achievements
Rank 1
Answers by
Ivan Petrov
Telerik team
Share this question
or