Q3 2011 New Validation Features

7 posts, 0 answers
  1. Walter
    Walter avatar
    22 posts
    Member since:
    Jun 2009

    Posted 17 Nov 2011 Link to this post

    Hello,
     
    Following this link http://www.telerik.com/support.rss I noticed some new features of the RadDataForm.
    • RadDataForm validation improvements.
    • Added: Support for custom validation errors (adding external errors).

     
    Could you please explain which validation improvements were added?
    I am also interested in how custom validation errors could be used.
     
    Thanks for your assistance
    Daniel

  2. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1128 posts

    Posted 17 Nov 2011 Link to this post

    Hi Daniel,

    With Q3 2011 we have introduced support for all the DataAnnotations validation attributes, even on auto-implemented properties. As for the second feature, clients would be able to add their own validation errors at runtime that are based on their custom logic. I have prepared a simple project that illustrates a these features on both autogenerated fields and manualy generated data templates. I am attaching it for your reference.

    Regards,
    Ivan Ivanov
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  3. DevCraft banner
  4. Vladimir
    Vladimir avatar
    6 posts
    Member since:
    Dec 2011

    Posted 01 Dec 2011 Link to this post

    hi
    tried the latest version of the control

     

    Required(ErrorMessage = "This property is required")] - WORKS

    [Required(ErrorMessageResourceType = typeof(Messages), ErrorMessageResourceName = "SMTH_MUST_BE_ENTERD")] - DOES NOT WORK

     

    [RegularExpression(clsConstants.REGEXP_ISVALIDEMAIL, ErrorMessageResourceName = "ErrorEmailInvalid", ErrorMessageResourceType = typeof(Messages))] - DOES NOT WORK


    Please confirm that it does not support error messages from resources or I did something wrong.
    thanks
    vladimir
  5. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1128 posts

    Posted 02 Dec 2011 Link to this post

    Hi Vladimir,

    I have prepared an example project that illustrates how to implement this. It is attached for your reference.
    It has been tested with the latest version of RadControls.

    Regards,
    Ivan Ivanov
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  6. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1128 posts

    Posted 02 Dec 2011 Link to this post

    Hi Daniel,

    Please excuse me for the inconvenience. I have missed to attach the project in my previous post.

    Kind regards,
    Ivan Ivanov
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  7. Vladimir
    Vladimir avatar
    6 posts
    Member since:
    Dec 2011

    Posted 02 Dec 2011 Link to this post

    Hi
    I tried the example
    it shows error in summary but it does not show on the field itself
    Vladimir
  8. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1128 posts

    Posted 02 Dec 2011 Link to this post

    Hi Vladimir,

    When validating an auto-implemented property the validation logic is not executed automatically in its setter. We utilize our own logic that explicitly validates them extracting the respective errors. However, in such a case, the BindingValidationError event is not raised and the field itself is clueless of this error. Microsoft's toolkit DataForm demonstrates similar behavior in scenarios when auto-implemented properties are used. 

    Greetings,
    Ivan Ivanov
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Back to Top
DevCraft banner