When my RadGrid is exported to Excel, if one of the cell's data begins with a dash (-), I get the error message "Excel cannot open the file because the file format or file extension is not valid..." see in the attached Error.png. If I remove leading dashes from the data by updating the database, or remove leading dashes in code before binding it to the grid, the grid exports as expected. However this is not an sustainable or ideal solution.
- I have tried setting the excel export to Xlsx, Html, Biff and ExcelIML in both cs code and in the designer (also tried each independent of each other):
AuthGrid.ExportSettings.Excel.Format = GridExcelExportFormat.Xlsx;
AuthGrid.MasterTableView.ExportToExcel();
<ExportSettings>
<Excel FileExtension="xlsx" Format="Xlsx" />
</ExportSettings>
- I have tried notes.DataFormatString = "{0}"; and notes.DataFormatString = " {0}";
I started with a slightly older version of these dlls, but also tried upgrading to newer versions:
- Telerik.Web.Spreadsheet version 2016.3.913.40 (upgraded to 2018.3.620.40)
- Telerik.Web.UI version 2016.3.914.45 (upgraded to 2018.2.710.45)
- Telerik.Web.UI.Skins version 2016.3.914.45 (upgraded to 2018.2.710.45)
- Telerik.Windows.Documents.Core version 2016.3.913.40 (upgraded to 2018.2.619.40)
- Telerik.Windows.Documents.Fixed version 2016.3.913.40 (upgraded to 2018.2.619.40)
- Telerik.Windows.Documents.Flow version 2016.3.913.40 (upgraded to 2018.2.619.40)
- Telerik.Windows.Documents.Spreadsheet version 2016.3.913.40 (upgraded to 2018.2.619.40)
- Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXML version 2016.3.913.40 (upgraded to 2018.2.619.40)
- Telerik.Windows.Zip version 2016.3.913.40 (upgraded to 2018.2.619.40)