• What is KendoReact
  • Getting Started
  • Server Components
  • Components
  • Sample Applications
  • Styling & Themes
  • Common Features
  • Project Setup
  • Knowledge Base
  • Changelog
  • Updates
  • Troubleshooting

TreeList Data Validation

Environment

Product Versionv7.2.3
ProductProgress® KendoReact

Description

I want to validate that data entered through the TreeList, whether it is newly added or modified through editing.

Solution

In order to add validation to the cell that is being edited, render a custom edit cell component (using the editCell prop) and handle the validation based on your requirement.

The example below demonstrates this approach where the variable isValid is set to false when the input length is less or equal to 4. Based on its value, the valid prop of the KendoReact Input component is set and shows a validation message. In addition, in the save function, the state is set only when isValid is set to true:

Example
View Source
Change Theme:

The above demo uses inline-editing that is explained in the below article. However, you can use any other editing approach.

In this article

Not finding the help you need?