Completed
Last Updated: 15 Jul 2019 08:33 by ADMIN
Release R3 2019 (LIB 2019.2.722)
Daniel
Created on: 14 Jun 2019 15:44
Category: GridView
Type: Bug Report
6
Export to Excel momentarily loses column sort

Steps to reproduce:

  1. Click column header to sort.
  2. Click button which to export to Excel.
  3. The rows return to unsorted.
  4. Scroll down slightly and scroll back up and the sort is restored.

This happens after calling RunExport.

I attached a gif and a sample project.

Attached Files:
1 comment
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 17 Jun 2019 06:42
Hello, Daniel,        

The provided sample project and gif file are greatly appreciated. Indeed, the obtained behavior is not correct. 

I have logged it in our feedback portal by making this thread public. You can track its progress, subscribe for status changes and add your comments on the following link - feedback item.

I have also updated your Telerik points.

Currently, the possible solution that I can suggest is to save the layout before performing the export functionality and restore it after that:

private void RadButtonExportToExcel_Click(object sender, EventArgs e)
{
    this.radGridView.CurrentRow = null;
    string s = "default.xml";
     
    this.radGridView.SaveLayout(s);
 
    var cvsExporter = new ExportToExcelML(this.radGridView);
    var path = Path.GetTempFileName();
    path = Path.ChangeExtension(path, "xls");
    cvsExporter.RunExport(path);
     
    this.radGridView.LoadLayout(s);
}

I would also recommend you to use the new GridViewSpreadExport  which utilized the RadSpreadProcessing library.

I hope this information helps. If you need any further assistance please don't hesitate to contact me.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.