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

auto width in Exporting to Excel

2 Answers 94 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Bertha
Top achievements
Rank 1
Bertha asked on 31 May 2018, 10:52 PM

How do I set the column width of Excel to auto fit or any fix width in Cell Formatting?  Thanks.

GridViewSpreadExport spreadExporter = new GridViewSpreadExport(gvInventory);
SpreadExportRenderer exportRenderer = new SpreadExportRenderer();
spreadExporter.CellFormatting += SpreadExporter_CellFormatting;
spreadExporter.ExportCompleted += SpreadExporter_ExportCompleted;
spreadExporter.RunExport(OutputFilePath, exportRenderer);             

2 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 01 Jun 2018, 09:25 AM
Hello Bertha,

This can be achieved by using the WorkbookCreated event which allows you to access the document before it is saved to a file. An example is available here: SpreadExportRenderer.

Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Bertha
Top achievements
Rank 1
answered on 01 Jun 2018, 12:45 PM

Perfect. Thanks.

Tags
GridView
Asked by
Bertha
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Bertha
Top achievements
Rank 1
Share this question
or