I would like to limit a grid text field to 255 characters. I've looked over events and don't see anything that would help with this. Has anyone accomplished this with the Kendo React Grid? Thank you
2 Answers, 1 is accepted
0
Accepted
Stefan
Telerik team
answered on 11 Nov 2020, 10:37 AM
Hello, Mark,
This can be achieved in two ways:
1) Use a custom cell with a custom Input component and set its maxlength attribute to 255. This will allow the user to type only 255 characters:
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Hi I want to use the second method but i am not sure how that would work. I want to create a new row and each field should have a different maxlength for user input.
Konstantin Dikov
Telerik team
commented on 17 Jan 2023, 08:58 AM
Hi Jonida,
The idea of the second approach is to use the "event.value" and check the length of the new value. If it is over 255, you can skip the call of the setElement which updates the data. This will keep the previous value within the editor.