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

How I change excel date format with Telerik Radgrid?

1 Answer 36 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mascherano
Top achievements
Rank 1
Mascherano asked on 26 Jan 2015, 10:34 AM
I using Radgrid excel export. I have date column and I need change format with excel.

Protected Sub RadGrid1_ExcelExportCellFormatting(ByVal sender As Object, ByVal e As ExcelExportCellFormattingEventArgs)
 
        If ((e.FormattedColumn.UniqueName) = "date") Then
 
            e.Cell.Style("mso-number-format") = "m\/d\/yy\"
        End If
    End Sub

and I used OnExcelExportCellFormatting in aspx file. My grid show true but my date column show like this in excel;

"4 january 2013 Friday 00:00:00"  

How I change date format for excel?

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 29 Jan 2015, 09:35 AM
Hi,

Try using the code below:
Protected Sub RadGrid1_ExportCellFormatting(sender As Object, e As ExportCellFormattingEventArgs)
    If (e.FormattedColumn.UniqueName) = "Uniquename" Then
        e.Cell.Style("mso-number-format") = "m.d.yy"
    End If
End Sub


Regards,
Maria Ilieva
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
Mascherano
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or