Class ExcelColumn
- Namespace
- OfficeOpenXml
- Assembly
- EPPlus.dll
Represents one or more columns within the worksheet
public class ExcelColumn
- Inheritance
-
ExcelColumn
- Inherited Members
Constructors
ExcelColumn(ExcelWorksheet, int)
Creates a new instance of the ExcelColumn class.
For internal use only!
protected ExcelColumn(ExcelWorksheet Worksheet, int col)
Parameters
Worksheet
ExcelWorksheetcol
int
Properties
BestFit
If set to true a column automaticlly resize(grow wider) when a user inputs numbers in a cell.
public bool BestFit { get; set; }
Property Value
Collapsed
If the column is collapsed in outline mode
public bool Collapsed { get; set; }
Property Value
ColumnMax
Sets the last column the definition refers to.
public int ColumnMax { get; set; }
Property Value
ColumnMin
Sets the first column the definition refers to.
public int ColumnMin { get; }
Property Value
Hidden
Defines if the column is visible or hidden
public bool Hidden { get; set; }
Property Value
Merged
Merges all cells of the column
public bool Merged { get; set; }
Property Value
OutlineLevel
Outline level. Zero if no outline
public int OutlineLevel { get; set; }
Property Value
PageBreak
Adds a manual page break after the column.
public bool PageBreak { get; set; }
Property Value
Phonetic
Phonetic
public bool Phonetic { get; set; }
Property Value
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.
public ExcelStyle Style { get; }
Property Value
StyleID
Sets the style for the entire column using the style ID.
public int StyleID { get; set; }
Property Value
StyleName
Sets the style for the entire column using a style name.
public string StyleName { get; set; }
Property Value
Width
Sets the width of the column in the worksheet
public double Width { get; set; }
Property Value
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.
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.
public void AutoFit(double MinimumWidth)
Parameters
MinimumWidth
doubleMinimum 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.
public void AutoFit(double MinimumWidth, double MaximumWidth)
Parameters
ToString()
Returns the range of columns covered by the column definition.
public override string ToString()
Returns
- string
A string describing the range of columns covered by the column definition.