- Home
- Forum
- ASP.NET MVC - EJ 2
- WorkSheet to DataTable - not able to preserve the actual datatype when adding a different value (string) on a column (with date format)
WorkSheet to DataTable - not able to preserve the actual datatype when adding a different value (string) on a column (with date format)
I have created an
export through Syncfusion where I have explicitly added Date format on one of
the columns.
It is getting
reflected on the excel file.
On earlier
version this was throwing an exception
var workSheetAsDataTable = workSheet.ExportDataTable(sheet.UsedRange, ExcelExportDataTableOptions.ColumnNames | ExcelExportDataTableOptions.DetectColumnTypes)
But it is fixed on the newer
versions with this enum added “DetectMixedValueType”.
Even though it is not throwing exception, the issue is that it is not preserving the original date format if user enters any string (which is not date) on any cell of the same column (where the Date format is added).
I
want to keep the datatype as DateTime format even if the user enters string on any
cell of that column. How can I achieve it?
- 4 Replies
- 2 Participants
- Marked answer
-
SB Souvik Bhanja
- Aug 26, 2020 12:46 PM UTC
- Sep 15, 2020 03:07 PM UTC