Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TdxSpreadSheetDefinedNames.Items Property

Provides indexed access to individual defined names declared in the document opened in a spreadsheet control.

#Declaration

Delphi
property Items[Index: Integer]: TdxSpreadSheetDefinedName read; default;

#Property Value

Type Description
TdxSpreadSheetDefinedName

A defined name in a spreadsheet document.

#Remarks

To identify the total number of defined names in the collection, use the Count property.

#Code Example: List All Defined Name Captions and References

The following code example lists captions and references of all defined names in the collection:

var
  I: Integer;
  ACaption, AReference: string;
//...
for I := 0 to dxSpreadSheet1.DefinedNames.Count - 1 do
  begin
    ACaption := dxSpreadSheet1.DefinedNames.Items[I].Caption;
    AReference := dxSpreadSheet1.DefinedNames.Items[I].Reference;
    cxMemo1.Lines.Strings[I] := ACaption + ' ' + AReference;
  end;

Note

To obtain an individual defined name by its caption instead of an index, call the GetItemByName function.

See Also