Hello,
Can someone tell me if its possible (and if so provide a snippet of code) on how to set up word wrapping from a WebDataGrid or WHDG to excel using WebExcelExporter?
Thanks.
Hi Bhadresh,
I am using v11.2. I need to set up the "Wrap Text false for all columns . I tried your solution but it didn't work and some of the columns width are too large.
How i can set the Columns width also of the same size.
protected void ExcelGrid_CellExporting(object sender, ExcelCellExportingEventArgs e)
{
e.Worksheet.Columns[e.CurrentColumnIndex].Width = 300;
e.Worksheet.Columns[e.CurrentColumnIndex].CellFormat.WrapText = Infragistics.Documents.Excel.ExcelDefaultableBoolean.False;
}
Thanks
Arshi
I am just following up to see if you were able to implement word wrapping while exporting data to excel based on details I have provided.
You can handle event like cell exporting of the WebExcelExporter and set cell format to wrap column text as shown below:
protected void WebExcelExporter1_CellExporting(object sender, ExcelCellExportingEventArgs e) { if (e.CurrentColumnIndex == 1) { e.WorksheetCell.CellFormat.WrapText = Infragistics.Documents.Excel.ExcelDefaultableBoolean.True; } }
I hope this helps