Hi,
I have the following problem, I've a SfDataGrid containing an arbitrary built DataTable created with a Query.
Some of the columns are strings containing numbers (codes) and the standard export made with the ExcelEngine ExportToExcel method, automatically converts the strings beginning with number in numbers loosing formatting and changing the meaning of codes.
I've looked in the ExcelExportingOptions but there is no option to tell the engine to mantain the type of the columns in the Excel worksheet
which is the best practice in this case?
I have three events in the exporting options of the engine:
ExportingEventHandler
ChildExportingEventHandler
CellsExportingEventHandler
None of the events allows me a direct access to the column type of the source so there is not a simple way to tell excel which columns are and must remain strings or change the content adding the apostrophe in front of the number when needed.
I was thinking to set a class level variable with the list of the string fields and check the cell content adding the leading apostrophe to the fields starting with a number when the column name is contained in the list but which is the best event where to do it, ChildExporting or CellsExporting, or maybe there is another way to tell the exporter to preserve the type of the cells?
thank you in advance
Sabrina