All docs
V20.1
20.1
19.2
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
Row

DataValidationCollection.Add(CellRange, DataValidationType, ValueObject) Method

Creates a new data validation entry and adds it to the document's collection.

Namespace: DevExpress.Spreadsheet

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

Declaration

DataValidation Add(
    CellRange range,
    DataValidationType validationType,
    ValueObject criteria
)
Function Add(
    range As CellRange,
    validationType As DataValidationType,
    criteria As ValueObject
) As DataValidation

Parameters

Name Type Description
range CellRange

A CellRange object that is the worksheet range to which the data validation rule is applied.

validationType DataValidationType

A DataValidationType enumeration member that specifies the validation type.

criteria ValueObject

A ValueObject that is the value used in the criterion.

Returns

Type Description
DataValidation

A DataValidation object that specifies a validation rule for a worksheet range.

Remarks

This method overload is used for validation types DataValidationType.Custom and DataValidationType.List.

For the DataValidationType.Custom type, the criteria is a string which can be recognized as a worksheet formula. Therefore, it must begin with an equal sign and evaluate to either true or false.

NOTE

An individual worksheet cell can have only one data validation rule associated with it. If subsequent Add method calls affect the same cell, only the data validation rule created in the last call is applied.

See Also