Click or drag to resize

Worksheet GetDefaultColumnStyle Method

Returns default column style.
Examples
The following code illustrates how to get default column style:
<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>//Get default style</para><para>CellStyle defaultStyle = worksheet.GetDefaultColumnStyle(2);</para><para>//Set color</para><para>defaultStyle.Color = Color.Blue;</para><para>worksheet.SetDefaultColumnStyle(3, defaultStyle);</para><para>//Save to file</para><para>workbook.SaveToFile("GetDefaultColumnStyle.xlsx");</para>

Namespace: Spire.Xls
Assembly: Spire.XLS (in Spire.XLS.dll) Version: 15.4.0.0 (15.4.0.5046)
Syntax
public CellStyle GetDefaultColumnStyle(
	int columnIndex
)

Parameters

columnIndex
Type: System Int32
Column index.

Return Value

Type: CellStyle
Default column style or null if default style is not exists.
See Also