Class ExcelColumn
Represents one or more columns within the worksheet
Inheritance
Inherited Members
Namespace: OfficeOpenXml
Assembly: EPPlus.dll
Syntax
public class ExcelColumn : IRangeID
Constructors
ExcelColumn(ExcelWorksheet, Int32)
Creates a new instance of the ExcelColumn class.
For internal use only!
Declaration
protected ExcelColumn(ExcelWorksheet Worksheet, int col)
Parameters
Type | Name | Description |
---|---|---|
ExcelWorksheet | Worksheet | |
System.Int32 | col |
Properties
BestFit
If set to true a column automaticlly resize(grow wider) when a user inputs numbers in a cell.
Declaration
public bool BestFit { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Collapsed
If the column is collapsed in outline mode
Declaration
public bool Collapsed { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
ColumnMax
Sets the last column the definition refers to.
Declaration
public int ColumnMax { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
ColumnMin
Sets the first column the definition refers to.
Declaration
public int ColumnMin { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Hidden
Defines if the column is visible or hidden
Declaration
public bool Hidden { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Merged
Merges all cells of the column
Declaration
public bool Merged { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
OutlineLevel
Outline level. Zero if no outline
Declaration
public int OutlineLevel { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
PageBreak
Adds a manual page break after the column.
Declaration
public bool PageBreak { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Phonetic
Phonetic
Declaration
public bool Phonetic { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Style
The Style applied to the whole column. Only effects cells with no individual style set. Use Range object if you want to set specific styles.
Declaration
public ExcelStyle Style { get; }
Property Value
Type | Description |
---|---|
ExcelStyle |
StyleID
Sets the style for the entire column using the style ID.
Declaration
public int StyleID { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
StyleName
Sets the style for the entire column using a style name.
Declaration
public string StyleName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Width
Sets the width of the column in the worksheet
Declaration
public double Width { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
Methods
AutoFit()
Set the column width from the content of the range. The minimum width is the value of the ExcelWorksheet.defaultColumnWidth property. Note: Cells containing formulas are ignored unless a calculation is performed. Wrapped and merged cells are also ignored.
Declaration
public void AutoFit()
AutoFit(Double)
Set the column width from the content. Note: Cells containing formulas are ignored unless a calculation is performed. Wrapped and merged cells are also ignored.
Declaration
public void AutoFit(double MinimumWidth)
Parameters
Type | Name | Description |
---|---|---|
System.Double | MinimumWidth | Minimum column width |
AutoFit(Double, Double)
Set the column width from the content. Note: Cells containing formulas are ignored unless a calculation is performed. Wrapped and merged cells are also ignored.
Declaration
public void AutoFit(double MinimumWidth, double MaximumWidth)
Parameters
Type | Name | Description |
---|---|---|
System.Double | MinimumWidth | Minimum column width |
System.Double | MaximumWidth | Maximum column width |
ToString()
Returns the range of columns covered by the column definition.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A string describing the range of columns covered by the column definition. |