I'm handling the UltraWebGridExcelExporter's OnInitializeColumn event in order to provide format currency properly in Excel. Here's an example of the method I typically use:
protected void uwgExcelExporter_InitializeColumn(object sender, InitializeColumnEventArgs e){ switch (e.Column.Key) { case "Target": case "Adjustment": case "AdjustedTarget": case "Difference": e.ExcelFormatString = EXCEL_FORMAT_CURRENCY; break; case "PercentageDifference": e.ExcelFormatString = EXCEL_FORMAT_PERCENTAGE; break; }}
When the column contains a WebCurrencyEdit control, this doesn't work properly and the numbers are exported to Excel as text. Does anyone know how to get around this?
Hello,
I usually use the CellExporting (for pre-processing) and CellExported (for post-processing) events to tweak the data being sent into Excel... Try handling one of those events instead. Inside these event handlers see what column the cell belongs to and if it is the one with your WebCurrencyEdit adjust the value and format there.