Class ExcelRangeColumn
- Namespace
- OfficeOpenXml
- Assembly
- EPPlus.dll
Represents a range of columns
public class ExcelRangeColumn : IEnumerable<ExcelRangeColumn>, IEnumerable, IEnumerator<ExcelRangeColumn>, IEnumerator, IDisposable
- Inheritance
-
ExcelRangeColumn
- Implements
- Derived
- Inherited Members
Properties
BestFit
Indicates that the column should resize when numbers are entered into the column to fit the size of the text. This only applies to columns where the size has not been set.
public bool BestFit { get; set; }
Property Value
Collapsed
If the column is collapsed in outline mode
public bool Collapsed { get; set; }
Property Value
Current
The current range when enumerating
public ExcelRangeColumn Current { get; }
Property Value
EndColumn
The last column in the collection
public int EndColumn { get; }
Property Value
Hidden
If the column is hidden.
public bool Hidden { get; set; }
Property Value
OutlineLevel
Outline level. Zero if no outline. Can not be negative.
public int OutlineLevel { get; set; }
Property Value
PageBreak
Adds a manual page break after the column.
public bool PageBreak { get; set; }
Property Value
Phonetic
True if the column should show phonetic
public bool Phonetic { get; set; }
Property Value
Range
Reference to the cell range of the column(s)
public ExcelRangeBase Range { get; }
Property Value
StartColumn
The first column in the collection
public int StartColumn { get; }
Property Value
Style
The Style applied to the whole column(s). 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
Row width of the column.
public double Width { get; set; }
Property Value
Methods
AutoFit()
Set the column width from the content of the range. Columns outside of the worksheets dimension are ignored. The minimum width is the value of the ExcelWorksheet.defaultColumnWidth property.
public void AutoFit()
Remarks
Cells containing formulas must be calculated before autofit is called. Wrapped and merged cells are also ignored.
AutoFit(double)
Set the column width from the content of the range. Columns outside of the worksheets dimension are ignored.
public void AutoFit(double MinimumWidth)
Parameters
MinimumWidthdoubleMinimum column width
Remarks
This method will not work if you run in an environment that does not support GDI. Cells containing formulas are ignored if no calculation is made. Wrapped and merged cells are also ignored.
AutoFit(double, double)
Set the column width from the content of the range. Columns outside of the worksheets dimension are ignored.
public void AutoFit(double MinimumWidth, double MaximumWidth)
Parameters
Remarks
This method will not work if you run in an environment that does not support GDI. Cells containing formulas are ignored if no calculation is made. Wrapped and merged cells are also ignored.
CollapseChildren(bool)
Collapses and hides the column's children. Children are columns immegetaly to the right or left of the column depending on the OutLineSummaryRight
allLevels
public void CollapseChildren(bool allLevels = true)
Parameters
allLevelsbool
Dispose()
Disposes this object
public void Dispose()
ExpandChildren(bool)
Expands and shows the column's children. Children are columns immegetaly to the right or left of the column depending on the OutLineSummaryRight
allLevels
public void ExpandChildren(bool allLevels = true)
Parameters
allLevelsbool
GetEnumerator()
Gets the enumerator
public IEnumerator<ExcelRangeColumn> GetEnumerator()
Returns
Group()
Groups the columns using an outline. Adds one to OutlineLevel for each column if the outline level is less than 8.
public void Group()
MoveNext()
Iterate to the next row
public bool MoveNext()
Returns
- bool
False if no more row exists
Reset()
Reset the enumerator
public void Reset()
SetVisibleOutlineLevel(int, bool)
Expands the rows to the OutlineLevel supplied.
public void SetVisibleOutlineLevel(int level, bool collapseChildren = true)
Parameters
levelintExpands all rows with a OutlineLevel Equal or Greater than this number.
collapseChildrenboolCollapses all children with a greater OutlineLevel than
level
UnGroup()
Ungroups the columns from the outline. Subtracts one from OutlineLevel for each column if the outline level is larger that zero.
public void UnGroup()