It takes more than a minute to export 15000 cells.
To reproduce:
public Form1()
{
InitializeComponent();
//populate with data
DataTable dt = new DataTable();
for (int i = 0; i < 50; i++)
{
dt.Columns.Add("Col" + i, typeof(string));
}
DataColumn col;
for (int i = 0; i < 3000; i++)
{
DataRow newRow = dt.Rows.Add();
for (int j = 0; j < dt.Columns.Count; j++)
{
col = dt.Columns[j];
newRow[col.ColumnName] = "Data." + i + " " + dt.Columns.IndexOf(col);
}
}
this.radGridView1.DataSource = dt;
this.radGridView1.BestFitColumns(Telerik.WinControls.UI.BestFitColumnMode.AllCells);
}
private void radButton1_Click(object sender, EventArgs e)
{
Telerik.WinControls.UI.Export.SpreadExport.SpreadExport spreadExporter;
spreadExporter = new SpreadExport(this.radGridView1,SpreadExportFormat.Xlsx
);
spreadExporter.ExportVisualSettings = false;
SaveFileDialog dialog = new SaveFileDialog();
dialog.FilterIndex = 1;
dialog.DefaultExt = "*.xlsx";
dialog.Filter = "Excel file |*.xlsx";
if (dialog.ShowDialog() == DialogResult.OK)
{
Stopwatch sw = new Stopwatch();
sw.Start();
string fileName = dialog.FileName;
spreadExporter.RunExport(fileName);
sw.Stop();
Console.WriteLine(string.Format("Elapsed {0}", sw.Elapsed));
Process.Start(fileName);
}
}