The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
Row

DataValidationOperator Enum

Lists comparison operators used in criteria for certain validation types.

Namespace: DevExpress.Spreadsheet

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

Declaration

public enum DataValidationOperator
Public Enum DataValidationOperator
public enum DataValidationOperator
Public Enum DataValidationOperator

Members

Name Description
Between

Determines whether the cell value falls within a specified range of values.

Equal

Determines whether the cell value equals a specified value.

GreaterThan

Determines whether the cell value is greater than the specified value.

GreaterThanOrEqual

Determines whether the cell value is greater than or equal to the specified value.

LessThan

Determines whether the cell value is less than the specified value.

LessThanOrEqual

Determines whether the cell value is less than or equal to the specified value.

NotBetween

Determines whether the cell value does not fall within a specified range of values.

NotEqual

Determines whether the cell value does not equal the specified value.

Remarks

The following code snippet uses the DataValidationOperator.GreaterThanOrEqual operator to create a new data validation criterion.

workbook.LoadDocument("Documents\\DataValidation.xlsx");
Worksheet worksheet = workbook.Worksheets[0];

// Restrict data entry to a number within limits.
DataValidation validation = worksheet.DataValidations.Add(worksheet["F4:F11"], DataValidationType.Decimal, DataValidationOperator.Between, 10, 40);

// Change the validation operator and criteria.
// Range F4:F11 should contain numbers greater than or equal 20.
validation.Operator = DataValidationOperator.GreaterThanOrEqual;
validation.Criteria = 20;
validation.Criteria2 = ValueObject.Empty;

// Highlight data validation ranges.
int[] MyColorScheme = new int[] { 0xFFC4C4, 0xFFD9D9, 0xFFF6F6, 0xFFECEC, 0xE9D3D3 };
for (int i = 0; i < worksheet.DataValidations.Count; i++)
{
    worksheet.DataValidations[i].Range.FillColor = Color.FromArgb(MyColorScheme[i]);
}
See Also