Class
NameCollection

Manages a collection of defined names within a workbook or worksheet scope, providing add, remove, and lookup operations.

Definition

Namespace:Telerik.Windows.Documents.Spreadsheet.Model

Assembly:Telerik.Windows.Documents.Spreadsheet.dll

Syntax:

cs-api-definition
public class NameCollection : IEnumerable<ISpreadsheetName>, IEnumerable

Inheritance: objectNameCollection

Implements: IEnumerableIEnumerable<ISpreadsheetName>

Properties

this[string]

Gets the ISpreadsheetName matching the specified name, using case-insensitive lookup.

Declaration

cs-api-definition
public ISpreadsheetName this[string name] { get; }

Parameters

name

string

Property Value

ISpreadsheetName

The defined name.

Methods

Add(string, string, CellIndex, string, bool)

Adds a new defined name with the specified formula reference at the given cell index.

Declaration

cs-api-definition
public ISpreadsheetName Add(string name, string refersTo, CellIndex cellIndex, string comment = null, bool isVisible = true)

Parameters

name

string

The name.

refersTo

string

The refers to.

cellIndex

CellIndex

Index of the cell.

comment

string

The comment.

isVisible

bool

The is visible.

Returns

ISpreadsheetName

Add(string, string, int, int, string, bool)

Adds a new defined name with the specified formula reference at the given cell location.

Declaration

cs-api-definition
public ISpreadsheetName Add(string name, string refersTo, int rowIndex, int columnIndex, string comment = null, bool isVisible = true)

Parameters

name

string

The name.

refersTo

string

The refers to.

rowIndex

int

Index of the row.

columnIndex

int

Index of the column.

comment

string

The comment.

isVisible

bool

The is visible.

Returns

ISpreadsheetName

Contains(string)

Checks whether a defined name with the specified identifier exists in the collection.

Declaration

cs-api-definition
public bool Contains(string name)

Parameters

name

string

The name.

Returns

bool

The value indicating whether the collection contains the specified name.

GetEnumerator()

Returns a strongly typed enumerator that iterates through the defined names in the collection.

Declaration

cs-api-definition
public IEnumerator<ISpreadsheetName> GetEnumerator()

Returns

IEnumerator<ISpreadsheetName>

A IEnumerator<T> that can be used to iterate through the collection.

Implements IEnumerable<ISpreadsheetName>.GetEnumerator()

Remove(string)

Removes the defined name matching the specified identifier from the collection.

Declaration

cs-api-definition
public void Remove(string name)

Parameters

name

string

The name.

TryGetSpreadsheetName(string, out ISpreadsheetName)

Attempts to retrieve the defined name matching the specified identifier.

Declaration

cs-api-definition
public bool TryGetSpreadsheetName(string name, out ISpreadsheetName spreadsheetName)

Parameters

name

string

The name.

spreadsheetName

ISpreadsheetName

The resulting name.

Returns

bool

The value indicating whether the name was successfully found.