New to Telerik UI for WinFormsStart a free 30-day trial

Captures the current selection state in a worksheet, including selected cell ranges, active cell, viewport pane, and selected shapes.

Definition

Namespace:Telerik.Windows.Documents.Spreadsheet.Model

Assembly:Telerik.Windows.Documents.Spreadsheet.dll

Syntax:

C#
public class SelectionState

Inheritance: objectSelectionState

Constructors

Initializes a new SelectionState with the specified selected ranges, active cell, and viewport pane.

C#
public SelectionState(IEnumerable<CellRange> selectedRanges, CellIndex activeCellIndex, ViewportPaneType pane)
Parameters:selectedRangesIEnumerable<CellRange>

The selected ranges.

activeCellIndexCellIndex

Index of the active cell.

paneViewportPaneType

The pane.

Properties

Gets the index of the active cell, which receives keyboard input and is the focus point for selection operations.

C#
public CellIndex ActiveCellIndex { get; }
Property Value:

The index of the active cell.

Gets the viewport pane where the selection is located, relevant when the worksheet has frozen panes.

C#
public ViewportPaneType Pane { get; }
Property Value:

The pane.

Gets the collection of cell ranges currently selected in the worksheet.

C#
public IEnumerable<CellRange> SelectedRanges { get; }
Property Value:

The selected ranges.

Methods

Creates a deep copy of this selection state.

C#
public SelectionState Clone()
Returns:

SelectionState

The cloned selection state.

Returns a string representation of this selection state, including pane, active cell, and selected ranges.

C#
public override string ToString()
Returns:

string

A string that represents the current object.

Overrides: object.ToString()