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

5 posts, 1 answers
  1. AP
    AP avatar
    261 posts
    Member since:
    Apr 2010

    Posted 25 Jan 2013 Link to this post

    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?
  2. Answer
    Petur Subev
    Petur Subev avatar
    1882 posts

    Posted 29 Jan 2013 Link to this post

    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.

    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!
  3. AP
    AP avatar
    261 posts
    Member since:
    Apr 2010

    Posted 29 Jan 2013 Link to this post

    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.

  4. Ben
    Ben avatar
    1 posts
    Member since:
    Jul 2014

    Posted 24 Feb 2015 in reply to Petur Subev Link to this post

    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? 


  5. Vladimir Iliev
    Vladimir Iliev avatar
    2206 posts

    Posted 26 Feb 2015 Link to this post

    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. 

    Vladimir Iliev

    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.

Back to Top