# TreeList Data Validation

## Environment

<table>
<tbody>
<tr>
<td>Product Version</td>
<td>v7.2.3</td>
</tr>
<tr>
<td>Product</td>
<td>Progress® KendoReact TreeList</td>
</tr>
</tbody>
</table>

## 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:

[Demo Source](https://demos.telerik.com/kendo-react-ui/knowledge-base/treelist/treelist-inline-editing-validation/source.txt)

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

* <https://www.telerik.com/kendo-react-ui/components/treelist/editing/editing-inline/>
