Back to Devexpress

DataValidation.ValidationType Property

officefileapi-devexpress-dot-spreadsheet-dot-datavalidation-9d237991.md

latest3.4 KB
Original Source

DataValidation.ValidationType Property

Gets the type of data validation.

Namespace : DevExpress.Spreadsheet

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
DataValidationType ValidationType { get; }
vb
ReadOnly Property ValidationType As DataValidationType

Property Value

TypeDescription
DataValidationType

A DataValidationType enumeration member that specifies the type of data validation used to validate user input.

|

Available values:

NameDescription
AnyValue

Any value satisfies validation criteria, equivalent to no validation.

| | WholeNumber |

Checks for whole numeric values satisfying given conditions.

| | Decimal |

Checks for decimal values satisfying the given condition.

| | List |

Checks whether a value matches a specified list of values. The maximum length of a list is 255 characters.

| | Date |

Checks for date values satisfying the given condition.

| | Time |

Checks for time values satisfying the given condition.

| | TextLength |

Checks for text values whose length satisfies the given condition.

| | Custom |

Data is validated using an arbitrary formula.

|

Remarks

To create a data validation entry of the required type, use the DataValidationCollection.Add method. To change the type of data validation, add new data validation for the required worksheet range. The former data validation will no longer be applied.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ValidationType 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-spreadsheetcontrol-api-part-3/VB/SpreadsheetControl_API_Part03/CodeExamples/DataValidationActions.vb#L123

vb
' Get data validation entries for the specified range.
Dim myValidation = worksheet.DataValidations.GetDataValidations(worksheet("D4:E11")).SingleOrDefault(Function(d) d.ValidationType = DevExpress.Spreadsheet.DataValidationType.TextLength)
If myValidation IsNot Nothing Then myValidation.Criteria = 4

See Also

DataValidation Interface

DataValidation Members

DevExpress.Spreadsheet Namespace