More in this section
Forums / Bugs & Issues / GridExcelExportFormat.Xlsx Date formatting issue

GridExcelExportFormat.Xlsx Date formatting issue

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. Aleksandr
    Aleksandr avatar
    1 posts
    28 Jan 2015
    14 Jan 2016
    Link to this post

    Hi Everyone,

    if I do not set export format i.e (RadGrid1.ExportSettings.Excel.Format = GridExcelExportFormat.Xlsx)

    grid will be exported as Excel 97-2003 format and Date cells formatted as they are displayed in the grid. 

    However once I set it (RadGrid1.ExportSettings.Excel.Format = GridExcelExportFormat.Xlsx) 

    cell containing dates are formatted differently to how they displayed in the Grid.

    Is it a bug, how can I get particular cells to preserve their formatting. 



  2. Viktor Tachev
    Viktor Tachev avatar
    1 posts
    30 Oct 2017
    18 Jan 2016
    Link to this post
    Hi Alex,

    By default Excel is trying to "guess" the content of its cells. Moreover, it applies format depending on the culture of the machine where the file is opened. Because of this the date format in the Excel file may be different.

    If you would like to ensure that Excel will show the date as expected you need to explicitly specify the format for the cells. Check out the following article that describes the approach.

    Viktor Tachev

    Consider using RadControls for ASP.NET AJAX (built on top of the ASP.NET AJAX framework) as a replacement for the Telerik ASP.NET Classic controls, See the product support lifecycle here.

2 posts, 0 answered