Hello,
We have noticed that exporting a WinGrid to Excel by using the UltraGridExcelExporter causes a InitializeRow to be triggered on every row during the initialization phase of the export (this is before the event ExportStarted is triggered).
We have a grid with rather complex functionality being processed in the initializerow, and this causes a long delay in the total export process. We are wondering if this is normal behaviour, or if there is a setting we can set to avoid this ?
Kind regards,
Michael
PS: version 11.2.20112.1010
Hi Michael,
This is correct behavior. The export process involves cloning the grid rows for exporting, so that you can modify the rows of the export without changing the on-screen rows. So the cloned rows have to be initialized.
If there is some part of your processing that you do not need to do in the export rows, then you could detect when the row is an export row like so:
e.Row.Band.Layout.IsExportLayout
I have an app where InitializeRow colors the BackgroundColor of each row according to a hierarchy:
But I want those colors to be omitted when I export to Excel. I tried using if (!r.Band.Layout.IsExportLayout) on the lines that color the background, and it correctly skips those lines during export. But the colors come through anyway:
How can I prevent this from happening?
Thanks.