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

DataFormatString & export to Excel

2 Answers 196 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Andy asked on 21 Jul 2011, 11:50 PM
Hi all,
 
I am using the GridBoundColumn to display my DateTime data.
And I use the  DataFormatString="{0:MM/dd/yyyy}"  to make time invisible.
However, when export to Excel, it appears (see Image)
I just want to display day only.
<telerik:GridBoundColumn HeaderText="ETA Date" UniqueName="ETA_Date" DataField="ETA_Date" DataFormatString="{0:MM/dd/yyyy}" ReadOnly="true" SortExpression="ETA_Date"  >
     <HeaderStyle Font-Bold="True" Wrap="False" HorizontalAlign="Center"></HeaderStyle>
      <ItemStyle Wrap="False" HorizontalAlign="Center"></ItemStyle>
</telerik:GridBoundColumn>

Thanks.

Andy,

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 22 Jul 2011, 05:38 AM
Hello Andy,

You can achieve this by using the mso-number-format style attribute. Check the following help documentation which explains more about this.
Word/Excel export (HTML-based).

Thanks,
Princy.
0
Andy
Top achievements
Rank 1
answered on 01 Aug 2011, 10:48 PM
Princy,

Thanks for your relying.
It works well.

Andy.
Tags
Grid
Asked by
Andy
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Andy
Top achievements
Rank 1
Share this question
or