I use ExpressiveAnnotations (https://github.com/jwaliszko/ExpressiveAnnotations) to use annotation-based conditional validation mechanisms in my forms.
(RequiredIf and AssertThat)
Now my question regarding Kendo MVC Grid Validation:
- is it correct, that Kendo Grid validation is only possible with "KendoValidation" and not with JQuery validation? (also in custom popup editor template?)
- is it possible to use ExpressiveAnnotations with "KendoValidation"?
5 Answers, 1 is accepted
The KendoValidator can work with custom attributes and it should work with the ExpressiveAnnotations library you are referring to. However, since this is a third party library we cannot guarantee that it will be fully compatible with Kendo validation. I would recommend to test the behavior in your project and ensure that everything works as expected.
Moreover, if you prefer you can use jQuery validation with the Kendo compoents. If you would like more information on using validation with the MVC wrappers please examine the following article.
Telerik by Progress
Hello Viktor, The example from that page rewrites the logic of validation, is there a way to avoid rewriting the validation logic and make it work with Kendo Validator?
There are couple of examples in the article. The first section illustrates how Kendo Validator can be used with built-in DataAnnotations. There are no custom rules applied for the validation in that example.
The second example shows how you can define custom attributes. It also shows how to define custom rules for the Validator component.
Would you elaborate on which example you are referring to? Also please describe the feature you would like to implement.
the first link is fine, basic data annotation works.
The second example however, pretty much rewrites the logic in the validation rule. the keyword here is rewrite. when you say Kendo Validator can work with custom Attribute, but the example you are showing rewrites the logic in the validator.
I am looking for example that uses kendo custom validation along side with kendo validator without rewriting the logic in jquery.
The example illustrates how to define custom validation rules. Since this is custom validation there is no predefined rule that would be serialized to the client. Furthermore, validation should be performed on both server- and client-side and this is what the example shows. The first part shows the server-side logic that will validate the data. The second part of the example shows the client-side validation.