Skip to main content
Row

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

IRangeProvider.ValidateReference(String, ReferenceStyle) Method

Validates the cell reference in accordance with the specified cell reference style.

Namespace: DevExpress.Spreadsheet

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

NuGet Package: DevExpress.Spreadsheet.Core

#Declaration

bool ValidateReference(
    string reference,
    ReferenceStyle style
)

#Parameters

Name Type Description
reference String

A cell reference to be validated.

style ReferenceStyle

An enumeration member that specifies the cell reference style.

#Returns

Type Description
Boolean

true, if the specified cell reference is valid; otherwise, false.

#Remarks

The example below shows how to use the ValidateReference method to check whether the specified cell references are valid.

worksheet.Range.ValidateReference("A1:C4", ReferenceStyle.A1); // returns true
worksheet.Range.ValidateReference("R[-5]C[4]:R1C[-2]", ReferenceStyle.R1C1); // returns true
worksheet.Range.ValidateReference("A1:B1:C1", ReferenceStyle.A1); // returns false
worksheet.Range.ValidateReference("Sheet1!R12C7", ReferenceStyle.R1C1); // returns false
See Also