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

Regular expression validation not woking in grid pop-up edit form

4 Answers 260 Views
Grid
This is a migrated thread and some comments may be shown as answers.
AP
Top achievements
Rank 1
Iron
Iron
Veteran
AP asked on 25 Jan 2013, 02:32 PM
I'm migrating a project based on the telerik MVC extensions, over to Kendo, and I'm having problems with an edit form.

It's based on a custom object, which uses data annotations for validation, on a couple of decimal fields:-
[Required(ErrorMessage = "Activity Value is required!")]
       [Range(0, 90000000, ErrorMessage = "Activity Value Cannot be less than zero!")]
       [RegularExpression(@"^\d{1,8}(\.\d{1,4})?$", ErrorMessage = "Please enter a numeric value with up to four decimal places.")]
       public decimal Activity { get; set; }

When a record is inserted, the regular expression validation error message is shown, even though the data entered meets the criteria. The only way to get the form to work is to comment out the regular expression rule. The range validation works fine.

This code worked perfectly using the old MVC extensions grid and pop-up edit form. How can I get this to work using the Kendo grid?

4 Answers, 1 is accepted

Sort by
0
Accepted
Petur Subev
Telerik team
answered on 29 Jan 2013, 08:56 AM
Hello Andrew,

I confirm that there is issue with the regular expression validation when using the Kendo Grid Wrapper for MVC.
We are aware of the problem and we are looking for a way to fix it. 
I am afraid that work-around is not available, however using different editing mode should not cause such behavior. 

I am sorry for the inconvenience caused.

Regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
AP
Top achievements
Rank 1
Iron
Iron
Veteran
answered on 29 Jan 2013, 08:59 AM
Ok, I've managed to get much of the same validation by using a numeric text box.

However it would be good to get regular expression validation working, as it was with the old MVC extensions.

0
Ben
Top achievements
Rank 1
answered on 24 Feb 2015, 04:57 PM
Hello Petur, 

 I tried to use regular expression in my view model, which is bound to the grid. Unfortunately, I get an error, if I try to validate using a regular expression: 

     0x800a139a - JavaScript runtime error: Unexpected quantifier

Is there still a problem with regular expression validation in Telerik/ Kendo Grid Wrapper for MVC? 

Thanks
 -Ben



0
Vladimir Iliev
Telerik team
answered on 26 Feb 2015, 12:58 PM
Hi Ben,

Please note that RegularExpression validation attribute is now fully supported - that why I would suggest to open a new support ticket / forum post and provide more information about your current Model and Grid configuration. This way we will be able to pinpoint the exact reason for current behavior. 

Regards,
Vladimir Iliev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
AP
Top achievements
Rank 1
Iron
Iron
Veteran
Answers by
Petur Subev
Telerik team
AP
Top achievements
Rank 1
Iron
Iron
Veteran
Ben
Top achievements
Rank 1
Vladimir Iliev
Telerik team
Share this question
or