Skip to main content
All docs
V19.1
.NET Framework 4.5.2+
Row

Range.GetRangeWithRelativeReference() Method

Returns the copy of the source range with its reference replaced by the relative reference.

Namespace: DevExpress.Spreadsheet

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

Declaration

Range GetRangeWithRelativeReference()

Returns

Type Description
Range

A Range object with the relative reference.

Remarks

Use the Range.GetRangeWithAbsoluteReference method to convert the source range to the range with the absolute reference.

Example

This example demonstrates how to use the Range.GetRangeWithAbsoluteReference and Range.GetRangeWithRelativeReference methods to get a range object with the source range reference converted to the absolute or relative reference, respectively.

using DevExpress.Spreadsheet;
// ...

Worksheet worksheet = spreadsheetControl.Document.Worksheets[0];
Range range = worksheet.Range["A$1:B$5"];

// Return the range with the absolute range reference - "$A$1:$B$5".
Range absRange = range.GetRangeWithAbsoluteReference();

// Return the range with the relative range reference - "A1:B5".
Range relRange = range.GetRangeWithRelativeReference();
See Also