Hi,
Specifically, I want to export data, with its numeric formatting intact into a new excel spreadsheet. All works fine, however the number formats(#,##0 and $#,##0.00) defined in the WinGrid designer are only exported in the column grand totals. How is the numeric formatting exported?
Looking forward to your advice.
Rick
Hello,
If you want to export an UltraGridColumn with its format, you should handle InitializeColumn event of the UltraGridExcelExporter and to set ExcelFormatStr of the argument using the code like the following in the mentioned event :
if (!string.IsNullOrEmpty(e.Column.Format))
{
e.ExcelFormatStr = e.Column.Format;
}
Let me know if you have any further questions.
Hi and Thanks. It worked perfectly. Below is the very slightly modified version for VB.
Private Sub g_igExcelExporter_InitializeColumn(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.ExcelExport.InitializeColumnEventArgs) Handles g_igExcelExporter.InitializeColumnIf Not (String.IsNullOrEmpty(e.Column.Format)) Then
e.ExcelFormatStr = e.Column.Format
End IfEnd Sub