Hi,
I have a ultraWingrid and I export the data from the grid to an Excel file using the UltraGridExcelExporter
Everything works find but I still have a little problem
In the ultraWingrid the header background is Blue and the font color is white
When I export the data to an excel file the name of the header is exported but the font color is white.
So we don't see the name of each column :(
So we think that the name of each column is not exported which is not the case. The problem is just that the font color is white. Is there a way we can change the font color before exporting the data or after or change the backgroud color of the header in the excel file.
Because the user that export the data always think that the name of each columnis not there.
You have to know that all the ultraWingrid and form in my application use a template for color so the application look the same in every form.
Thanks in advance and have a nice day
Yes, you can change the forecolor of the header text just for the export without affecting the grid. What you do is handle the BeginExport event of the UltraGridExcelExporter. This event passes you a Layout, which is a clone of the grid's DisplayLayout. Since it's a clone, you can make any changes you want to this layout and it will affect the Exported Excel file, but have no effect on the on-screen grid. So you could set e.Layout.Override.HeaderAppearance.ForeColor, for example. You may, depending on the original grid settings, also need to turn off themes by setting ThemedElementAlpha (on the same appearance) to Transparent.
Having said that, you really should not need to work around this issue. The exported Excel file should be exporting the background color of the header cells as well as the forecolor. So if that's not happening, then something else is wrong, and you might want to resolve that issue rather than work around it.
Thanks for your answers I appreciate
I try what you suggest but it doesn't work
I desactivate the template we use for the application color of the forms ,grids, controls etc.. and then your code that you suggest work when the template is not set
Soon as I put back the template for the application the code you suggest doesn't work
It is like the template have priority over everything
Or there is something that I have to set somewhere that I don't know.
I understand when you say that the background color should be exported to the excel file but it doesn't
What I don't understand is Why the fore color for the text is exported and why not the backcolor of the header
Do you have any idea?
Thanks in advance!