This is a migrated thread and some comments may be shown as answers.

How to let validation on Kendo Grid cell take action on lose cursor?

5 Answers 81 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Daochuen
Top achievements
Rank 1
Iron
Veteran
Iron
Daochuen asked on 25 Sep 2020, 04:57 PM

Hello,

I defined my class field “TeamCode” as string type and only accept 4 characters. It function well in regular Kendo TextBox. But it does not work on Kendo grid cell when do editing. Validation not happen when box lose cursor. I knew clicking submit/Add/Update button validation will go through, but I still hope validation occurring on lose cursor. Is anyone have an idea to do so? (Below are partial of code)

 ...
            [StringLength(4, MinimumLength = 4, ErrorMessage = "{0} must be 4 characters.")]
            [DisplayName("Team Code")]
            public string TeamCode { get; set; }
 …

Thanks.

 

 

5 Answers, 1 is accepted

Sort by
0
Accepted
Nikolay
Telerik team
answered on 29 Sep 2020, 12:47 PM

Hello Zhihong,

I tested myself Grid filed validation over DataAnnotation Attributes and I can say it works correctly. Upon blurring out the edited field the validator is fired and a validation message is displayed

More information on validation can be obtained in the following article:

For your convenience, I am attaching the testing project. Please examine it and let me know if you have any questions.

Regards,
Nikolay
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

0
Daochuen
Top achievements
Rank 1
Iron
Veteran
Iron
answered on 29 Sep 2020, 07:05 PM
Thanks Nikolay. The Code you applied works well. I need recheck my code.
0
Nikolay
Telerik team
answered on 01 Oct 2020, 10:28 AM

Hi Zhihong,

You are most welcome and please let me know if anything further arises.

Regards,
Nikolay
Progress Telerik

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/.

0
Daochuen
Top achievements
Rank 1
Iron
Veteran
Iron
answered on 01 Oct 2020, 03:28 PM

Thanks for your help Nikolay! I just have another post  with title "Length validation in cell does not work on Kendo Grid cell edit ".

Could you take a look? Thank you very much.

0
Nikolay
Telerik team
answered on 05 Oct 2020, 09:55 AM

Hi Zhihong,

Another colleague of mine is already working on it. Please expect a reply shortly.

Regards,
Nikolay
Progress Telerik

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/.

Tags
Grid
Asked by
Daochuen
Top achievements
Rank 1
Iron
Veteran
Iron
Answers by
Nikolay
Telerik team
Daochuen
Top achievements
Rank 1
Iron
Veteran
Iron
Share this question
or