Hi,
I want to apply wrap text on whole column rather than going and apply wrap text on each single cell
I tried following code but it does not work
private void StyleSheet(Worksheet sheet)
{
var cells = sheet.Cells;
var range = sheet.Cells.MaxDisplayRange;
for (int columnIndex = 0; columnIndex < range.ColumnCount + 1; columnIndex++)
{
Style style = sheet.Cells?.Columns[columnIndex]?.Style;
sheet.Cells.SetColumnWidth(columnIndex, 20);
sheet.Cells.ApplyColumnStyle(columnIndex,style, new StyleFlag()
{
WrapText = true
});
/*sheet.Cells.Columns[columnIndex].ApplyStyle(style, new StyleFlag()
{
WrapText = true
});*/
}
}