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

Q3 2011 New Validation Features

6 Answers 78 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Walter
Top achievements
Rank 1
Walter asked on 17 Nov 2011, 01:44 PM
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

6 Answers, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 17 Nov 2011, 03:46 PM
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 >>
0
Vladimir
Top achievements
Rank 1
answered on 02 Dec 2011, 05:01 AM
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
0
Ivan Ivanov
Telerik team
answered on 02 Dec 2011, 08:51 AM
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 >>
0
Ivan Ivanov
Telerik team
answered on 02 Dec 2011, 08:58 AM
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 >>
0
Vladimir
Top achievements
Rank 1
answered on 02 Dec 2011, 02:11 PM
Hi
I tried the example
it shows error in summary but it does not show on the field itself
Vladimir
0
Ivan Ivanov
Telerik team
answered on 02 Dec 2011, 02:56 PM
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 >>
Tags
DataForm
Asked by
Walter
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Vladimir
Top achievements
Rank 1
Share this question
or