I have an Ultragrid where each row spans multiple rows in the layout. How can I flatten my grid while exporting into an Excel file as a single row using UltragridExcelExporter?
I tried ClearGroupByColumns, but my file is still not flat.
Irena
Hi Irena,
This depends on how you are setting up the layout of your grid. Are you using RowLayouts or Groups and Levels? Or are you using a different method? Please let me know.
ClearGroupByColumns is used to clear out GroupBy sorting of rows and doesn't apply to your layout.
Mike, thank you for replying.
I am using RowLayouts, no groups or levels
You can flatten your grid by disabling RowLayouts in the UltraGridExcelExporter's ExportStarted event. Set the UseRowLayout property to false on the bands that you are exporting. Once the grid is flat, you may want to set the order of the columns. This can be done by setting the VisiblePosition property on the Column's Header. Please note that you must set the indexes in order from the lowest to the highest, as the grid performs some validation and reordering when this property is set.
Please let me know if this works in the way you expect.
Mike, thank you for pointing me in the right direction. I used ResetUseRowLayout method and my excel file looks perfect now.