Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
675
Litle problem with UltraGridExcelExporter
posted

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

 

 

 

Parents
No Data
Reply
  • 469350
    Suggested Answer
    Offline posted

    Hi,

    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.

Children