Search code examples
.netexport-to-excelinfragisticsultrawingrid

Exporting with expanded rows when grouped by column header


I am using the Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter to export an UltraGrid into Excel. The UltraGrid is currently grouped by a column header. When exporting to Excel it retains this information. You need to expand the group to view the contents of this row. You can do this easy in excel by pushing the 2 button.

However my question is: How do you export to Excel with the rows under the column header automatically expanded, instead of collapsed?

I have tried adding an event:

myExport.RowExported += myExport_RowExported;

Then in the event adding:

void myExport_RowExported(object sender, Infragistics.Win.UltraWinGrid.ExcelExport.RowExportedEventArgs e)
    {
        e.CurrentWorksheet.Rows[e.CurrentRowIndex].Hidden = false;
    }

This still did not work, any ideas?


Solution

  • I couldn't find any posts for this apart from setting the hidden property to false for each row. I managed to achieve this by setting the outlining property to none:

    I hope this helps someone else.

    myExport.OutliningStyle = Infragistics.Win.UltraWinGrid.ExcelExport.OutliningStyle.None;