Excel date format string not applied
New DiscussionHi,
I have been trying to set the date format to worksheet cell but it not working. Here’s what i have –
row.Cells[columnIndex].CellFormat.FormatString = “mm/dd/yyyy h:mm AM/PM”;
row.Cells[columnIndex].CellFormat.Alignment = HorizontalCellAlignment.Right;
Due to this the filter does not work as expected. The column is considered as a text –

But the same when i do by opening the Excel from my system and then set the format, the column is correctly set as Date and the filter looks like below –

The one in the second image is the expected outcome.
Can you please help me fix this ?
Sign In
to post a reply
Replies
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Favorites
0 Replies
4 Created On
Jul 17, 2019 Last Post
6 years, 7 months ago