Click or drag to resize

IWorksheet 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.Core
Assembly: Spire.XLS (in Spire.XLS.dll) Version: 15.4.0.0 (15.4.0.5046)
Syntax
IStyle GetDefaultColumnStyle(
	int iColumnIndex
)

Parameters

iColumnIndex
Type: System Int32
Column index.

Return Value

Type: IStyle
Default column style or null if style wasn't set.
See Also