Skip to main content
Row

DefinedNameCollection.Contains(String) Method

Indicates whether the collection contains the defined name with the specified DefinedName.Name property value.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v24.1.Core.dll

NuGet Package: DevExpress.Spreadsheet.Core

Declaration

bool Contains(
    string name
)

Parameters

Name Type Description
name String

A string that is the DefinedName.Name property value of the defined name to locate in the collection.

Returns

Type Description
Boolean

true, if the collection contains the defined name; otherwise, false.

Remarks

Each defined name has a scope that can be a particular worksheet or entire workbook. So, each worksheet and workbook has it’s own collection of defined names (DefinedNameCollection) that is accessed via the Worksheet.DefinedNames or Workbook.DefinedNames property respectively. Each name must be unique in its scope. To check whether a specific name already exists in a scope, use the Contains method.

To obtain the specified defined name from the collection, use the DefinedNameCollection.GetDefinedName method.

To add a new defined name to the collection, use the DefinedNameCollection.Add method.

To delete defined names from the collection, use the DefinedNameCollection.Remove, DefinedNameCollection.RemoveAt or DefinedNameCollection.Clear methods.

See Also