Hi,
I would like to know if it's possible to export the current (which ever it is) expanded child band, without exporting the parent or any other child bands to Excel.
Hello,
Currently the exporter has two modes in which to export data - DataInGridOnly and AllDataInDataSource. My recommendation is to use DataInGridOnly mode and handle RowExporting server event. From there you can access the row which is being exported and cancel this action. From the event args you can check if the row is with level 0 (parent row) or level 1 (child row).
Code snippet:
protected void Button2_Click(object sender, EventArgs e) { this.excelExporter2.DisableCellValueFormatting = true; this.excelExporter2.DataExportMode = DataExportMode.DataInGridOnly; this.excelExporter2.WorkbookFormat = Infragistics.Documents.Excel.WorkbookFormat.Excel2007; this.excelExporter2.ExportMode = ExportMode.Download; Infragistics.Documents.Excel.Workbook wb = new Infragistics.Documents.Excel.Workbook(); wb.Worksheets.Add(WebHierarchicalDataGrid1.ID); this.excelExporter2.Export(WebHierarchicalDataGrid1, wb.Worksheets[WebHierarchicalDataGrid1.ID], 0, 0); Response.Clear(); Response.AppendHeader("content-disposition", "attachment; filename= file.xls"); Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; Response.Charset = ""; wb.Save(Response.OutputStream); } protected void excelExporter2_RowExporting(object sender, ExcelRowExportingEventArgs e) { int i = 0; }