Back to Devexpress

DefinedName.Range Property

officefileapi-devexpress-dot-spreadsheet-dot-definedname-769390cb.md

latest3.2 KB
Original Source

DefinedName.Range Property

Gets or sets a cell range to which the defined name refers.

Namespace : DevExpress.Spreadsheet

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
CellRange Range { get; set; }
vb
Property Range As CellRange

Property Value

TypeDescription
CellRange

A CellRange object.

|

Remarks

Use the Range property to obtain an object that specifies a cell range associated with the defined name. If a defined name refers to a formula or constant, the Range property returns null (Nothing in VB). If a defined name refers to a relative range, the Range property gets a cell range relative to the A1 cell. For more information on defined names, see the Defined Names document.

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

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.

winforms-spreadsheet-use-custom-cell-editors/CS/DevAVInvoicing/Form1.cs#L186

csharp
sheet.Rows[rowIndex].Height = sheet.Rows[rowIndex + 1].Height;
CellRange range = invoiceItems.Range;
CellRange itemRange = sheet.Range.FromLTRB(range.LeftColumnIndex, range.BottomRowIndex, range.RightColumnIndex, range.BottomRowIndex);

winforms-spreadsheet-use-custom-cell-editors/VB/DevAVInvoicing/Form1.vb#L173

vb
sheet.Rows(rowIndex).Height = sheet.Rows(rowIndex + 1).Height
Dim range As CellRange = invoiceItems.Range
Dim itemRange As CellRange = sheet.Range.FromLTRB(range.LeftColumnIndex, range.BottomRowIndex, range.RightColumnIndex, range.BottomRowIndex)

See Also

Defined Names

DefinedName Interface

DefinedName Members

DevExpress.Spreadsheet Namespace