Back to Devexpress

DefinedNameCollection.Clear() Method

officefileapi-devexpress-dot-spreadsheet-dot-definednamecollection.md

latest3.0 KB
Original Source

DefinedNameCollection.Clear() Method

Removes all defined names from the collection.

Namespace : DevExpress.Spreadsheet

Assembly : DevExpress.Spreadsheet.v25.2.Core.dll

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
void Clear()
vb
Sub Clear

Remarks

Note that calling the Clear method also disposes all elements removed from the collection.

To remove an individual defined name from the collection, use the DefinedNameCollection.Remove or DefinedNameCollection.RemoveAt methods.

Note

After you delete a defined name, all cells using that name will display the #NAME? error. After you delete a named cell or cell range, all cells using defined names that refer to the deleted cell or cell range will display the #REF! error.

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

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Clear() method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

spreadsheet-document-api-create-loan-amortization-schedule-within-blazor-server-app/CS/BlazorAppSpreadsheet/Code/DocumentGenerator.cs#L79

csharp
Sheet["I6:I8"].ClearContents();
    workbook.DefinedNames.Clear();
}

See Also

Defined Names

DefinedNameCollection Interface

DefinedNameCollection Members

DevExpress.Spreadsheet Namespace