+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / GridExcelExportFormat.Xlsx Date formatting issue

GridExcelExportFormat.Xlsx Date formatting issue

2 posts, 0 answered
  1. Aleksandr
    Aleksandr avatar
    1 posts
    Registered:
    28 Jan 2015
    14 Jan
    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. 

    Cheers,

    Alex

  2. Viktor Tachev
    Viktor Tachev avatar
    1 posts
    Registered:
    02 Dec 2016
    18 Jan
    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.





    Regards,
    Viktor Tachev
    Telerik
     

    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