New to Telerik UI for WinForms? Download free 30-day trial

Troubleshooting

Exported file is corrupt and will not open in Excel 2003 or Excel 2007

Check for invalid DateTime values, such as "0001-01-01T00:00:00.000". MS Excel does not support DateTime values before "1900-01-01". UPDATE: Since R1 2010 the ExportToExcelML method validates the date values and throws a FormatException with message: "The DateTime value is not supported in Excel!".

RadGridView Cannot Export Images

Images cannot be exported to MS Excel, because Excel does not support embedded images in cells. In addition, the ExportToExcelML method uses a special XML format which cannot include images by specification.

Exporting data programmatically creates a blank Excel document

Since ExportToExcelML iterates through the grid elements, it does not export anything if the grid has not created its child elements yet (i.e. if there is a grid instance but it is not shown on a form). The solution is to use the LoadElementTree method before running the export: 

this.radGridView1.LoadElementTree();

Me.RadGridView1.LoadElementTree()

MS Excel does not open the file directly after exporting the data from RadGridView (it prompts to save the file instead)

The ExportToExcelML class does not support opening the excel file directly. However, you can easily implement similar functionality through the Process.Start method:

ExportToExcelML exporter = new ExportToExcelML(this.radGridView1);
exporter.RunExport(@"C:\Test.xls");
System.Diagnostics.Process.Start(@"C:\Test.xls");

Dim exporter As ExportToExcelML = New ExportToExcelML(Me.RadGridView1)
exporter.RunExport("C:\Test.xls")
System.Diagnostics.Process.Start("C:\Test.xls")

Wrong text alignment for rows with conditional formatting

ExportToExcelML does not support all text alignment settings for the conditional formatting; because of this ExportToExcelML takes and applies current conditional formatting alignments, but RadGridView skips the default values. This will be improved in future versions of RadGridView, but there is a workaround we can suggest, so feel free to open a support ticket to request it.

See Also

In this article