# GC.Spread.Sheets.DataValidation.CriteriaType

## Content

# Enumeration: CriteriaType

[Sheets](../modules/GC.Spread.Sheets).[DataValidation](../modules/GC.Spread.Sheets.DataValidation).CriteriaType

Indicates the data validator criteria type.

**`example`**
```
//This example uses the CriteriaType enumeration.
var textLengthCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.textLengthCondition);
textLengthCondition.compareType(GC.Spread.Sheets.ConditionalFormatting.GeneralComparisonOperators.greaterThan);
textLengthCondition.formula("$C$1"); // formula used to calculate a number.
var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(textLengthCondition);
validator.type(GC.Spread.Sheets.DataValidation.CriteriaType.custom);
activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).validator(validator);
spread.options.highlightInvalidData = true;
activeSheet.setValue(0, 0, "abcf");
//Set value 3 to $C$1, after this code, the value in Cell(0,0) is valid.
activeSheet.setValue(0, 2, 3);
//Set value 5 to $C$1, after this code, the value in Cel(0,0) is invalid.
// activeSheet.setValue(0, 2, 5);
```

## Table of contents

### Enumeration members

- [anyValue](GC.Spread.Sheets.DataValidation.CriteriaType#anyvalue)
- [custom](GC.Spread.Sheets.DataValidation.CriteriaType#custom)
- [date](GC.Spread.Sheets.DataValidation.CriteriaType#date)
- [decimalValues](GC.Spread.Sheets.DataValidation.CriteriaType#decimalvalues)
- [list](GC.Spread.Sheets.DataValidation.CriteriaType#list)
- [textLength](GC.Spread.Sheets.DataValidation.CriteriaType#textlength)
- [time](GC.Spread.Sheets.DataValidation.CriteriaType#time)
- [wholeNumber](GC.Spread.Sheets.DataValidation.CriteriaType#wholenumber)

## Enumeration members

### <a id="anyvalue" name="anyvalue"></a> anyValue

• **anyValue** = `0`

Specifies that the data validation allows any type of value and does not check for a type or range of values.

___

### <a id="custom" name="custom"></a> custom

• **custom** = `7`

Specifies that the data validation uses a custom formula to check the cell value.

___

### <a id="date" name="date"></a> date

• **date** = `4`

Specifies that the data validation checks for and allows date values satisfying the given condition.

___

### <a id="decimalvalues" name="decimalvalues"></a> decimalValues

• **decimalValues** = `2`

Specifies that the data validation checks for and allows decimal values satisfying the given condition.

___

### <a id="list" name="list"></a> list

• **list** = `3`

Specifies that the data validation checks for and allows a value that matches one in a list of values.

___

### <a id="textlength" name="textlength"></a> textLength

• **textLength** = `6`

Specifies that the data validation checks for and allows text values whose length satisfies the given condition.

___

### <a id="time" name="time"></a> time

• **time** = `5`

Specifies that the data validation checks for and allows time values satisfying the given condition.

___

### <a id="wholenumber" name="wholenumber"></a> wholeNumber

• **wholeNumber** = `1`

Specifies that the data validation checks for and allows whole number values satisfying the given condition.
