This is a migrated thread and some comments may be shown as answers.

Dates doesn't show up right in when downloaded to excel

4 Answers 133 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tess
Top achievements
Rank 1
Tess asked on 08 Nov 2017, 08:36 PM

Hi,

 

I've radGrid in which I display couple of date columns. I format the date using DataFormatString property. It displays good in grid as I want. But when downloaded to excel the values don't make any sense to me. 

<CommandItemSettings ShowExportToExcelButton="true" ShowAddNewRecordButton="false" ShowRefreshButton="false" />
 
<telerik:GridBoundColumn DataField="LiquidationDate" UniqueName="LiquidationDate" HeaderText="Liquidation Date" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />

 

Attached images to show how they are displayed in grid vs excel. Please help. 

4 Answers, 1 is accepted

Sort by
0
Tess
Top achievements
Rank 1
answered on 08 Nov 2017, 08:40 PM
Here is the Grid image. I've attached both Excel images in my post..
0
Accepted
Attila Antal
Telerik team
answered on 13 Nov 2017, 10:49 AM
Hi Tess,

Try using the following format "{0:MM/dd/yyyy}" and see if that works for you.

<telerik:GridBoundColumn DataField="LiquidationDate" UniqueName="LiquidationDate" HeaderText="Liquidation Date" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:MM/dd/yyyy}" />

You can test the basic sample I've attached.

Kind Regards,
Attila Antal
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Tess
Top achievements
Rank 1
answered on 13 Nov 2017, 02:10 PM
Thank you Attila Antal. It worked.
0
Attila Antal
Telerik team
answered on 13 Nov 2017, 03:25 PM
Hi Tess,

I am glad the solution helped.

Good luck with your project!

Kind Regards,
Attila Antal
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Tess
Top achievements
Rank 1
Answers by
Tess
Top achievements
Rank 1
Attila Antal
Telerik team
Share this question
or