Skip to main content
Row

IRangeProvider.Parse(String, ReferenceStyle) Method

Returns a cell range by its reference string in the specified reference style.

Namespace: DevExpress.Spreadsheet

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

NuGet Package: DevExpress.Spreadsheet.Core

Declaration

CellRange Parse(
    string reference,
    ReferenceStyle style
)

Parameters

Name Type Description
reference String

A string that is the cell range reference in the reference style specified by the style parameter.

style ReferenceStyle

A ReferenceStyle enumeration member that specifies the cell reference style.

Returns

Type Description
CellRange

A CellRange object.

Exceptions

Type Description
InvalidOperationException

Thrown if the specified reference is invalid.

Remarks

Get the IRangeProvider object via the Worksheet.Range property and use the Parse method to access a cell range object. The second parameter specifies the reference style in which the cell range reference should be passed. If you skip this parameter or set it to ReferenceStyle.A1, the cell range reference (the reference parameter) should be in the A1 reference style. You can also use the IRangeProvider.Item or Worksheet.Item property to get a cell range by its A1 reference. If you need to get a cell range by its R1C1 reference or by its reference in the style used in the workbook (DocumentSettings.R1C1ReferenceStyle), set the style parameter to ReferenceStyle.R1C1 or ReferenceStyle.UseDocumentSettings, respectively.

To get a cell range by the indexes of the bounding rows and columns, use the IRangeProvider.FromLTRB method.

­SpreadsheetControl_Range_Access

See Also