How I change excel date format with Telerik Radgrid?

2 posts, 0 answers
  1. Mascherano
    Mascherano avatar
    4 posts
    Member since:
    Jan 2015

    Posted 26 Jan 2015 Link to this post

    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?
  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 29 Jan 2015 Link to this post

    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.

     
Back to Top