Click or drag to resize

Worksheet SetDefaultColumnStyle Method

Overload List
Name Description
Public method Code example SetDefaultColumnStyle(Int32, CellStyle)
Sets default style for column.
Examples
The following code illustrates how to set the default style for a column:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create style</para><para>CellStyle style = workbook.Styles.Add("CustomStyle");</para><para>//Set Color</para><para>style.Color = Color.Red;</para><para>//Set default style</para><para>worksheet.SetDefaultColumnStyle(2, style);</para><para>//Save to file</para><para>workbook.SaveToFile("SetDefaultColumnStyle.xlsx");</para>
Public method SetDefaultColumnStyle(Int32, IStyle)
Sets default style for column.
(Inherited from XlsWorksheet .)
Public method Code example SetDefaultColumnStyle(Int32, Int32, CellStyle)
Sets default style for column.
Examples
The following code illustrates how to set the default style for columns:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create style</para><para>CellStyle style = workbook.Styles.Add("CustomStyle");</para><para>//Set Color</para><para>style.Color = Color.Red;</para><para>//Set default style</para><para>worksheet.SetDefaultColumnStyle(2, 5, style);</para><para>//Save to file</para><para>workbook.SaveToFile("SetDefaultColumnStyle.xlsx");</para>
Public method SetDefaultColumnStyle(Int32, Int32, IStyle)
Sets by column index default style for column.
(Inherited from XlsWorksheet .)
Top
See Also