New to Kendo UI for Vue? Start a free 30-day trial

Data Validation

Updated on Nov 26, 2026

The Kendo UI for Vue Spreadsheet lets you control the data that users enter in the cells. A validation rule checks every value that is typed in a cell and either rejects it or warns the user.

The following example demonstrates the validation rules in action. The Quantity column accepts only numbers between 1 and 100, the Status column provides a list of allowed values, and the Discount % column warns the user about unusual values.

Example
View Source
Loading ...

Using the Data Validation Dialog

By default, the Data tab of the toolbar contains the Data Validation tool. To set a rule, users select a range of cells, open the dialog, and configure the following options:

OptionDescription
Cell RangeThe range of cells to which the rule applies, for example, B2:B9.
CriteriaThe type of data that the cells accept—Any value, Number, Text, Date, Custom formula, or List.
ComparerThe comparison that is applied to the value—between, not between, equal to, not equal to, greater than, less than, greater than or equal to, or less than or equal to.
Min, Max, or ValueThe values the entered data is compared to.
Ignore blankSpecifies whether the cell can be left empty.
On invalid dataSpecifies whether the Spreadsheet rejects the invalid value (Reject input) or displays a warning and lets the user keep it (Show warning).
Show hintDisplays a tooltip with a title and a message when the user selects the cell.

To remove the rule, set the Criteria to Any value.

Setting the Validation in the Data

To define the validation rules when the data is loaded, set the validation field of the cell in the defaultProps sheets. The following example restricts a cell to numbers between 1 and 100 and rejects every other value:

js
const sheets = [
    {
        name: 'Orders',
        rows: [
            {
                cells: [
                    {
                        value: 20,
                        validation: {
                            dataType: 'number',
                            comparerType: 'between',
                            from: '1',
                            to: '100',
                            allowNulls: false,
                            type: 'reject',
                            tooltipTitleTemplate: 'Quantity',
                            tooltipMessageTemplate: 'Enter a number between {0} and {1}.',
                            titleTemplate: 'Invalid quantity',
                            messageTemplate: 'The quantity must be between {0} and {1}.'
                        }
                    }
                ]
            }
        ]
    }
];

The validation object supports the following fields:

FieldDescription
dataTypeThe type of the accepted data—number, text, date, custom, or list.
comparerTypeThe comparison that is applied—between, notBetween, equalTo, notEqualTo, greaterThan, lessThan, greaterThanOrEqualTo, or lessThanOrEqualTo. For the list data type, use equalTo. For the custom data type, the rule is the formula in from.
fromThe value or formula to compare to. For a between or notBetween comparison, this is the lower bound. For a list, the allowed items are quoted and separated by commas, for example, '"New","Shipped"'.
toThe upper bound for a between or notBetween comparison.
allowNullsSpecifies whether the cell can be empty.
typeThe behavior on invalid data—reject or warning. The default value is warning.
showButtonSpecifies whether the cells with a list or a date rule display a drop-down button.
tooltipTitleTemplate and tooltipMessageTemplateThe title and the message of the hint that is displayed when the cell is selected.
titleTemplate and messageTemplateThe title and the message of the dialog that is displayed when the entered value is invalid.

The templates can use the {0} and {1} placeholders, which are replaced with the evaluated from and to values.

Setting the Validation Programmatically

To apply or remove a rule at runtime, use the executeCommand method of the Spreadsheet with the EditValidationCommand command. Pass the range in the operatingRange option and the rule in the value option. To remove the validation, pass null as a value.

js
spreadsheet.value.executeCommand({
    command: 'EditValidationCommand',
    options: {
        operatingRange: spreadsheet.value.activeSheet().range('E2:E9'),
        value: {
            dataType: 'number',
            comparerType: 'between',
            from: '0',
            to: '30',
            type: 'reject'
        }
    }
});

The Reject discounts above 30 in E2:E9 button in the demo above uses this approach.