New to Telerik Document ProcessingStart a free 30-day trial

Manages hyperlinks attached to cell ranges in a worksheet, tracking links through insert/remove operations.

Definition

Namespace:Telerik.Windows.Documents.Spreadsheet.Model

Assembly:Telerik.Windows.Documents.Spreadsheet.dll

Syntax:

C#
public class HyperlinkCollection : CellRangeInsertedOrRemovedAwareCollection<SpreadsheetHyperlink>, IEnumerable<SpreadsheetHyperlink>, IEnumerable

Inheritance: objectCellRangeInsertedOrRemovedAwareCollectionBaseCellRangeInsertedOrRemovedAwareCollection<SpreadsheetHyperlink>HyperlinkCollection

Implements: IEnumerableIEnumerable<SpreadsheetHyperlink>

Inherited Members CellRangeInsertedOrRemovedAwareCollection<SpreadsheetHyperlink>.TranslateRange(CellRange, CellRange)CellRangeInsertedOrRemovedAwareCollection<SpreadsheetHyperlink>.GetEnumerator()CellRangeInsertedOrRemovedAwareCollection<SpreadsheetHyperlink>.CountCellRangeInsertedOrRemovedAwareCollection<SpreadsheetHyperlink>.WorksheetCellRangeInsertedOrRemovedAwareCollection<SpreadsheetHyperlink>.CellRangesCellRangeInsertedOrRemovedAwareCollection<SpreadsheetHyperlink>.ElementsCellRangeInsertedOrRemovedAwareCollectionBase.CanInsertOrRemove(ShiftType, CellRange, CellRange)CellRangeInsertedOrRemovedAwareCollectionBase.ShouldTranslateUpDown(RangeType)CellRangeInsertedOrRemovedAwareCollectionBase.ShouldTranslateLeftRight(RangeType)CellRangeInsertedOrRemovedAwareCollectionBase.TranslateRanges(Dictionary<CellRange, CellRange>)CellRangeInsertedOrRemovedAwareCollectionBase.OnBeforeTranslation(Dictionary<CellRange, CellRange>, CellRange, ShiftType)CellRangeInsertedOrRemovedAwareCollectionBase.OnAfterTranslation(Dictionary<CellRange, CellRange>, CellRange, ShiftType)CellRangeInsertedOrRemovedAwareCollectionBase.Cells...

Constructors

Initializes a new HyperlinkCollection for the specified worksheet.

C#
public HyperlinkCollection(Worksheet worksheet)
Parameters:worksheetWorksheet

The worksheet.

Events

Raised after a hyperlink is added or removed from the collection.

C#
public event EventHandler Changed

Methods

Adds a hyperlink to the specified cell and returns the created hyperlink instance.

C#
public SpreadsheetHyperlink Add(CellIndex cellIndex, HyperlinkInfo hyperlinkInfo)
Parameters:cellIndexCellIndex

Index of the cell.

hyperlinkInfoHyperlinkInfo

The hyperlink info.

Returns:

SpreadsheetHyperlink

The new hyperlink.

Adds a hyperlink to the specified cell range, replacing any existing hyperlink in that exact range, and applies hyperlink styling.

C#
public SpreadsheetHyperlink Add(CellRange cellRange, HyperlinkInfo hyperlinkInfo)
Parameters:cellRangeCellRange

The cell range.

hyperlinkInfoHyperlinkInfo

The hyperlink info.

Returns:

SpreadsheetHyperlink

The new hyperlink.

Adds the specified element when cellRange is inserted.

C#
protected override SpreadsheetHyperlink Add(CellRange cellRange, SpreadsheetHyperlink element)
Parameters:cellRangeCellRange

The cell range.

elementSpreadsheetHyperlink

The element.

Returns:

SpreadsheetHyperlink

Overrides: CellRangeInsertedOrRemovedAwareCollection<SpreadsheetHyperlink>.Add(CellRange, SpreadsheetHyperlink)

Checks whether the specified hyperlink exists in the collection by range equality.

C#
public bool Contains(SpreadsheetHyperlink hyperlink)
Parameters:hyperlinkSpreadsheetHyperlink

The hyperlink.

Returns:

bool

A value indicating whether the collection contains the specified hyperlink.

Finds all hyperlinks whose ranges are fully contained within the specified cell range.

C#
public IEnumerable<SpreadsheetHyperlink> GetContainingHyperlinks(CellRange cellRange)
Parameters:cellRangeCellRange

The cell range.

Returns:

IEnumerable<SpreadsheetHyperlink>

The collection of contained hyperlinks.

Finds all hyperlinks whose ranges are fully contained within any of the specified cell ranges.

C#
public IEnumerable<SpreadsheetHyperlink> GetContainingHyperlinks(IEnumerable<CellRange> cellRanges)
Parameters:cellRangesIEnumerable<CellRange>

The cell ranges.

Returns:

IEnumerable<SpreadsheetHyperlink>

The collection of contained hyperlinks.

Finds all hyperlinks whose ranges overlap with the specified cell range.

C#
public IEnumerable<SpreadsheetHyperlink> GetIntersectingHyperlinks(CellRange cellRange)
Parameters:cellRangeCellRange

The cell range.

Returns:

IEnumerable<SpreadsheetHyperlink>

The collection of intersecting hyperlinks.

Called when the collection is changed.

C#
protected virtual void OnChanged()

Removes elements when cellRange is removed.

C#
protected override bool Remove(CellRange cellRange)
Parameters:cellRangeCellRange

The cell range.

Returns:

bool

Overrides: CellRangeInsertedOrRemovedAwareCollection<SpreadsheetHyperlink>.Remove(CellRange)

Removes the specified hyperlink and reverts its cells to default styling.

C#
public bool Remove(SpreadsheetHyperlink hyperlink)
Parameters:hyperlinkSpreadsheetHyperlink

The hyperlink.

Returns:

bool

The value indicating whether the remove was successful.

Attempts to find any hyperlink intersecting the specified cell, returning the last one if multiple exist.

C#
public bool TryGetHyperlink(CellIndex cellIndex, out SpreadsheetHyperlink hyperlink)
Parameters:cellIndexCellIndex

Index of the cell.

hyperlinkSpreadsheetHyperlink

The hyperlink.

Returns:

bool

The value indicating whether a hyperlink was found.

Attempts to find any hyperlink intersecting the specified cell range, returning the last one if multiple exist.

C#
public bool TryGetHyperlink(CellRange cellRange, out SpreadsheetHyperlink hyperlink)
Parameters:cellRangeCellRange

The cell range.

hyperlinkSpreadsheetHyperlink

The hyperlink.

Returns:

bool

The value indicating whether a hyperlink was found.

Attempts to find a hyperlink with a range that exactly matches the specified cell range.

C#
public bool TryGetHyperlinkExact(CellRange cellRange, out SpreadsheetHyperlink hyperlink)
Parameters:cellRangeCellRange

The cell range.

hyperlinkSpreadsheetHyperlink

The hyperlink.

Returns:

bool

The value indicating whether a hyperlink was found.