On saving excel file. the column width specified in code is not getting reflected in saved excel file. I have written this code where I have set width of column as 600.
Any help is highly appreciated.
protected void btnExportFile_Click(object sender, EventArgs e)
{
int aIndex = 0;
//turn off paging
UltraWebGrid1.DisplayLayout.Pager.AllowPaging = false;
DynamicReportSelection();
this.GridExcelExporter.DownloadName = txtFilePath.Text;
this.GridExcelExporter.ExportMode = ExportMode.Download;
//this.GridExcelExporter.Export(this.UltraWebGrid1)
Workbook wb= this.GridExcelExporter.Export(UltraWebGrid1)
foreach (Worksheet ws in wb.Worksheets)
ws.Columns[aIndex].Width = 600;
aIndex++;
}}
After exporting the datagrid to Excel. It ask for save and on clicking on Save its not showing the column with width specified in the code. Please suggest.