This project has moved and is read-only. For the latest updates, please go here.

Enterprise Validation Block - ValidationProvider to DxErrorProvider?

Sep 9, 2007 at 12:16 PM
Edited Sep 9, 2007 at 12:18 PM
If any of you have seen the new Enterprise Application Block 3.0 - one of the blocks that looks pretty interesting to me, is the Validation Block.

http://davidhayden.com/blog/dave/archive/2006/12/23/ValidationApplicationBlockEnterpriseLibrary3PartI.aspx

And since there's a WinForm control called the ValidationProvider I'm wondering whether this will integrate with the DxErrorProvider. I use the DxErrorProvider so I'm quite interested in this. I haven't spent much time looking at the ValidationProvider control though. Even if we did write something to pull it in, I'm not sure whether this is the best project to host it.
http://codebetter.com/blogs/david.hayden/archive/2007/01/24/Validation-Application-Block-Presentation-and-New-Features-_2D00_-Enterprise-Library-3.0.aspx
Feb 25, 2008 at 8:56 AM
this would be useful.

The build in ValidationProvider cannot be easily extented.
Oct 21, 2008 at 2:25 PM
Hi,

i know i am one year late, but do we have any news about this? I am using Validation Block and having problem with the WinForms integration, ValidationProvider and DXErrorProvider. I am also using LayoutControl on my forms.

Thank you.
Nov 11, 2008 at 5:14 PM
Really would be interesting to know.
Please, share with your experience in the topic.


Thanks
Jan 15, 2009 at 5:13 AM
I'm also looking into this topic at the moment. I will share my findings.
Dec 9, 2010 at 4:33 PM

Hi,

We actually solved this problem by subclassing DXErrorProvider and overriding

IsDataObjectSupported to return true and GetErrorInfo to build up your Error Info where you can just validate the Property with EntLib.

PropertyInfo propertyInfo = validatedObject.GetType().GetProperty(propertyName); 
Validator propertyValidator = PropertyValidationFactory.GetPropertyValidator(validatedObject.GetType(), propertyInfo, ruleset, ValidationSpecificationSource.All, new MemberAccessValidatorBuilderFactory()); 
ValidationResults results = propertyValidator.Validate(validatedObject); 
if (!results.IsValid)
{
//errorInfo.Text = ...

hope this helps!