This is a migrated thread and some comments may be shown as answers.

Exporting Headers to Excel & CSV

1 Answer 9 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Stephen
Top achievements
Rank 1
Stephen asked on 08 Sep 2014, 08:59 PM
Hello,

I am using RadGrid (version 2014.1.403.45) and I need to export a header to PDF, Excel, and CSV.  For PDF, this is accomplished easily, by using the "Pdf-PageTitle" property on the <ExportSettings>.  Is there something similar for Excel and CSV?  If not, is there a workaround?

Thanks,
Steve

1 Answer, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 11 Sep 2014, 12:35 PM
Hello Steve,

Could you please let me know which export format you are using to export the grid to Excel? In order to add a title to csv you could simply hook OnGridExporting event handler and modify the export output. Please check out the following code snippet.
protected void RadGrid1_GridExporting(object sender, Telerik.Web.UI.GridExportingArgs e)
{
    e.ExportOutput = e.ExportOutput.Insert(0, "\"Title\"\r\n");
}
Generally you could use a similar approach if you are using a Html based (default format)on export.

Regards,
Kostadin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Stephen
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Share this question
or