Table of Contents

Interface IXLColumn

Namespace
SlapKit.Excel.Excel
Assembly
SlapKit.Excel.dll
public interface IXLColumn : IXLRangeBase, IXLAddressable
Inherited Members
Extension Methods

Properties

IsHidden

Gets a value indicating whether this column is hidden or not.

bool IsHidden { get; }

Property Value

bool

true if this column is hidden; otherwise, false.

OutlineLevel

Gets or sets the outline level of this column.

int OutlineLevel { get; set; }

Property Value

int

The outline level of this column.

Width

Gets or sets the width of this column in number of characters (NoC).

double Width { get; set; }

Property Value

double

Remarks

NoC are a non-linear units displayed as a column width in Excel, next to pixels. NoC combined with default font of the workbook can express width of the column in pixels and other units.

Methods

AddVerticalPageBreak()

Adds a vertical page break after this column.

IXLColumn AddVerticalPageBreak()

Returns

IXLColumn

AdjustToContents()

Adjusts the width of the column based on its contents.

IXLColumn AdjustToContents()

Returns

IXLColumn

AdjustToContents(double, double)

IXLColumn AdjustToContents(double minWidth, double maxWidth)

Parameters

minWidth double
maxWidth double

Returns

IXLColumn

AdjustToContents(int)

Adjusts the width of the column based on its contents, starting from the startRow.

IXLColumn AdjustToContents(int startRow)

Parameters

startRow int

The row to start calculating the column width.

Returns

IXLColumn

AdjustToContents(int, double, double)

IXLColumn AdjustToContents(int startRow, double minWidth, double maxWidth)

Parameters

startRow int
minWidth double
maxWidth double

Returns

IXLColumn

AdjustToContents(int, int)

Adjusts the width of the column based on its contents, starting from the startRow and ending at endRow.

IXLColumn AdjustToContents(int startRow, int endRow)

Parameters

startRow int

The row to start calculating the column width.

endRow int

The row to end calculating the column width.

Returns

IXLColumn

AdjustToContents(int, int, double, double)

Adjust width of the column according to the content of the cells.

IXLColumn AdjustToContents(int startRow, int endRow, double minWidth, double maxWidth)

Parameters

startRow int

Number of a first row whose content is considered.

endRow int

Number of a last row whose content is considered.

minWidth double

Minimum width of adjusted column, in NoC.

maxWidth double

Maximum width of adjusted column, in NoC.

Returns

IXLColumn

Cell(int)

Gets the cell in the specified row.

IXLCell Cell(int rowNumber)

Parameters

rowNumber int

The cell's row.

Returns

IXLCell

CellCount()

int CellCount()

Returns

int

Cells(int, int)

Returns the specified group of cells.

IXLCells Cells(int firstRow, int lastRow)

Parameters

firstRow int

The first row in the group of cells to return.

lastRow int

The last row in the group of cells to return.

Returns

IXLCells

Cells(string)

Returns the specified group of cells, separated by commas.

e.g. Cells("1"), Cells("1:5"), Cells("1,3:5")

IXLCells Cells(string cellsInColumn)

Parameters

cellsInColumn string

The column cells to return.

Returns

IXLCells

Clear(XLClearOptions)

Clears the contents of this column.

IXLColumn Clear(XLClearOptions clearOptions = XLClearOptions.All)

Parameters

clearOptions XLClearOptions

Specify what you want to clear.

Returns

IXLColumn

Collapse()

Show this column as collapsed.

IXLColumn Collapse()

Returns

IXLColumn

Column(IXLCell, IXLCell)

IXLRangeColumn Column(IXLCell start, IXLCell end)

Parameters

start IXLCell
end IXLCell

Returns

IXLRangeColumn

Column(int, int)

IXLRangeColumn Column(int start, int end)

Parameters

start int
end int

Returns

IXLRangeColumn

ColumnLeft()

IXLColumn ColumnLeft()

Returns

IXLColumn

ColumnLeft(int)

IXLColumn ColumnLeft(int step)

Parameters

step int

Returns

IXLColumn

ColumnLetter()

Gets this column's letter

string ColumnLetter()

Returns

string

ColumnNumber()

Gets this column's number

int ColumnNumber()

Returns

int

ColumnRight()

IXLColumn ColumnRight()

Returns

IXLColumn

ColumnRight(int)

IXLColumn ColumnRight(int step)

Parameters

step int

Returns

IXLColumn

ColumnUsed(XLCellsUsedOptions)

IXLRangeColumn ColumnUsed(XLCellsUsedOptions options = XLCellsUsedOptions.AllContents)

Parameters

options XLCellsUsedOptions

Returns

IXLRangeColumn

Columns(string)

IXLRangeColumns Columns(string columns)

Parameters

columns string

Returns

IXLRangeColumns

CopyTo(IXLCell)

IXLRangeColumn CopyTo(IXLCell cell)

Parameters

cell IXLCell

Returns

IXLRangeColumn

CopyTo(IXLColumn)

IXLColumn CopyTo(IXLColumn column)

Parameters

column IXLColumn

Returns

IXLColumn

CopyTo(IXLRangeBase)

IXLRangeColumn CopyTo(IXLRangeBase range)

Parameters

range IXLRangeBase

Returns

IXLRangeColumn

Delete()

Deletes this column and shifts the columns at the right of this one accordingly.

void Delete()

Remarks

Don't use in a loop due to poor performance. Use Delete(XLShiftDeletedCells) instead.

Expand()

Expands this column (if it's collapsed).

IXLColumn Expand()

Returns

IXLColumn

Group()

Adds this column to the next outline level (Increments the outline level for this column by 1).

IXLColumn Group()

Returns

IXLColumn

Group(bool)

Adds this column to the next outline level (Increments the outline level for this column by 1).

IXLColumn Group(bool collapse)

Parameters

collapse bool

If set to true the column will be shown collapsed.

Returns

IXLColumn

Group(int)

Sets outline level for this column.

IXLColumn Group(int outlineLevel)

Parameters

outlineLevel int

The outline level.

Returns

IXLColumn

Group(int, bool)

Sets outline level for this column.

IXLColumn Group(int outlineLevel, bool collapse)

Parameters

outlineLevel int

The outline level.

collapse bool

If set to true the column will be shown collapsed.

Returns

IXLColumn

Hide()

Hides this column.

IXLColumn Hide()

Returns

IXLColumn

InsertColumnsAfter(int)

Inserts X number of columns at the right of this one.

All columns at the right will be shifted accordingly.

IXLColumns InsertColumnsAfter(int numberOfColumns)

Parameters

numberOfColumns int

The number of columns to insert.

Returns

IXLColumns

InsertColumnsBefore(int)

Inserts X number of columns at the left of this one.

This column and all at the right will be shifted accordingly.

IXLColumns InsertColumnsBefore(int numberOfColumns)

Parameters

numberOfColumns int

The number of columns to insert.

Returns

IXLColumns

Sort(XLSortOrder, bool, bool)

IXLColumn Sort(XLSortOrder sortOrder = XLSortOrder.Ascending, bool matchCase = false, bool ignoreBlanks = true)

Parameters

sortOrder XLSortOrder
matchCase bool
ignoreBlanks bool

Returns

IXLColumn

Ungroup()

Adds this column to the previous outline level (decrements the outline level for this column by 1).

IXLColumn Ungroup()

Returns

IXLColumn

Ungroup(bool)

Adds this column to the previous outline level (decrements the outline level for this column by 1).

IXLColumn Ungroup(bool fromAll)

Parameters

fromAll bool

If set to true it will remove this column from all outline levels.

Returns

IXLColumn

Unhide()

Unhides this column.

IXLColumn Unhide()

Returns

IXLColumn