Class
Columns

Manages all columns in a worksheet, providing access to column properties, widths, and visibility.

Definition

Namespace:Telerik.Windows.Documents.Spreadsheet.Model

Assembly:Telerik.Windows.Documents.Spreadsheet.dll

Syntax:

cs-api-definition
public class Columns : RowsColumnsBase

Inheritance: objectWorksheetEntityBaseRowsColumnsBaseColumns

Inherited Members RowsColumnsBase.Insert(int)RowsColumnsBase.Insert(int, int)RowsColumnsBase.Remove(int)RowsColumnsBase.Remove(int, int)RowsColumnsBase.CellsWorksheetEntityBase.Worksheet

Properties

Count

The total number of columns in the worksheet.

Declaration

cs-api-definition
public override int Count { get; }

Property Value

int

The row / column count.

Overrides RowsColumnsBase.Count

this[CellIndex]

Accesses the column containing the specified cell index.

Declaration

cs-api-definition
public ColumnSelection this[CellIndex cellIndex] { get; }

Parameters

cellIndex

CellIndex

Property Value

ColumnSelection

The column selection.

this[CellRange]

Accesses the columns intersecting the specified cell range.

Declaration

cs-api-definition
public ColumnSelection this[CellRange cellRange] { get; }

Parameters

cellRange

CellRange

Property Value

ColumnSelection

The column selection.

this[IEnumerable<CellRange>]

Accesses the columns intersecting a collection of cell ranges.

Declaration

cs-api-definition
public ColumnSelection this[IEnumerable<CellRange> cellRanges] { get; }

Parameters

cellRanges

IEnumerable<CellRange>

Property Value

ColumnSelection

The column selection.

this[int, int]

Accesses a range of columns by start and end indices, returning a selection for batch operations.

Declaration

cs-api-definition
public ColumnSelection this[int fromIndex, int toIndex] { get; }

Parameters

fromIndex

int

toIndex

int

Property Value

ColumnSelection

The column selection.

this[int]

Accesses a single column by index, returning a selection for applying properties or operations.

Declaration

cs-api-definition
public ColumnSelection this[int index] { get; }

Parameters

index

int

Property Value

ColumnSelection

The column selection.

Methods

CanInsert(int, int)

Checks whether the specified number of columns can be inserted at the given index without exceeding worksheet limits.

Declaration

cs-api-definition
public override bool CanInsert(int index, int itemCount)

Parameters

index

int

The index.

itemCount

int

The item count.

Returns

bool

The value indicating whether this instance can be inserted at the specified index

Overrides RowsColumnsBase.CanInsert(int, int)

GetColumnSelection(CellIndex)

Creates a selection for the column containing the specified cell index.

Declaration

cs-api-definition
public ColumnSelection GetColumnSelection(CellIndex cellIndex)

Parameters

cellIndex

CellIndex

Index of the cell.

Returns

ColumnSelection

The column selection.

GetColumnSelection(CellRange)

Creates a selection for the columns intersecting the specified cell range.

Declaration

cs-api-definition
public ColumnSelection GetColumnSelection(CellRange cellRange)

Parameters

cellRange

CellRange

The cell range.

Returns

ColumnSelection

The column selection.

GetColumnSelection(IEnumerable<CellRange>)

Creates a selection for the columns intersecting a collection of cell ranges.

Declaration

cs-api-definition
public ColumnSelection GetColumnSelection(IEnumerable<CellRange> cellRanges)

Parameters

cellRanges

IEnumerable<CellRange>

The cell ranges.

Returns

ColumnSelection

The column selection.

GetColumnSelection(int)

Creates a selection for the column at the specified index.

Declaration

cs-api-definition
public ColumnSelection GetColumnSelection(int index)

Parameters

index

int

The index.

Returns

ColumnSelection

The column selection.

GetColumnSelection(int, int)

Creates a selection for the range of columns between the start and end indices.

Declaration

cs-api-definition
public ColumnSelection GetColumnSelection(int fromIndex, int toIndex)

Parameters

fromIndex

int

From index.

toIndex

int

To index.

Returns

ColumnSelection

The column selection.

GetDefaultWidth()

Retrieves the default width applied to all columns without explicit width settings.

Declaration

cs-api-definition
public ColumnWidth GetDefaultWidth()

Returns

ColumnWidth

The column width

InsertOverride(int, int)

Inserts the specified number of columns at the given index, shifting existing columns to the right.

Declaration

cs-api-definition
protected override bool InsertOverride(int index, int itemCount)

Parameters

index

int

The index.

itemCount

int

The item count.

Returns

bool

Overrides RowsColumnsBase.InsertOverride(int, int)

RemoveOverride(int, int)

Removes the specified number of columns starting at the given index, shifting remaining columns to the left.

Declaration

cs-api-definition
protected override void RemoveOverride(int index, int itemCount)

Parameters

index

int

The index.

itemCount

int

The item count.

Overrides RowsColumnsBase.RemoveOverride(int, int)

SetDefaultWidth(ColumnWidth)

Sets the default width for all columns without explicit width settings.

Declaration

cs-api-definition
public void SetDefaultWidth(ColumnWidth width)

Parameters

width

ColumnWidth

The width.

Events

ColumnsWidthChanged

Raised when one or more column widths change, providing the affected column index range.

Declaration

cs-api-definition
public event EventHandler<RowColumnPropertyChangedEventArgs> ColumnsWidthChanged

Event Value

EventHandler<RowColumnPropertyChangedEventArgs>