To reproduce:
this.radGridView1.DataSource = this.ordersBindingSource;
GridViewDateTimeColumn col = this.radGridView1.Columns["OrderDate"] as GridViewDateTimeColumn;
col.ExcelExportType = DisplayFormatType.GeneralDate;
col.ExcelExportFormatString = "dd-MMM-yy";
private void radButton1_Click(object sender, EventArgs e)
{
SpreadExport spreadExporter = new SpreadExport(radGridView1);
spreadExporter.RunExport(@"..\..\..\exportedFileQ12015.xlsx");
Process.Start(@"..\..\..\exportedFileQ12015.xlsx");
}
Workaround:
private void radButton1_Click(object sender, EventArgs e)
{
SpreadExport spreadExporter = new SpreadExport(radGridView1);
spreadExporter.CellFormatting += spreadExporter_CellFormatting;
spreadExporter.RunExport(@"..\..\..\exportedFileQ12015.xlsx");
Process.Start(@"..\..\..\exportedFileQ12015.xlsx");
}
private void spreadExporter_CellFormatting(object sender, Telerik.WinControls.UI.Export.SpreadExport.CellFormattingEventArgs e)
{
if (e.GridColumnIndex == 3 && e.GridCellInfo.Value is DateTime)
{
CellValueFormat cvf = new CellValueFormat("dd-MMM-yy");
e.CellSelection.SetFormat(cvf);
}
}