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
1612
How to prevent formatting while export to Excel
posted
I have well formatted numeric columns in ultraGrid.
When exporting to Excel I'm loosing numeric formats

Eg. I'm using ###,###,##0.00 mask for thousands separating
After Excel export numbers are not formatted as in grid

How to archive that?

Thanks
Maciej
Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi Maciej,

    The formats in DotNet are not always the same as the formats in Excel. They use a different set of format strings. So the grid can't automatically use the same formats when exporting to excel.

    In order to handle this, the UltraGridExcelExporter has an event called InitializeColumn where you can get the format applied to the grid column and set the format to be applied to the Excel cells. Very often they are the same so you can just assign one to the other. But sometimes you might need to translate from a DotNet format into one Excel can handle.

Children