Exception raised by ValidationProvider

Topics: Validation Application Block
Jun 1, 2007 at 11:12 AM
The ValidationProvider on Windows Forms may raise ValueConversion exceptions, e.g. when validating an Int16 type.

I could/should prevent such exceptions by first checking int the ValueConvert event of the ValidationProvider but this results in a lot of code - what about the VAB, should it not send the exception to the ValidationPerformed event (much like the BindingComplete pattern on Windows Forms)?

Anybody an idea how I can catch a ValidationProvider exception in a nice way?
Jun 1, 2007 at 5:37 PM
I don't know of a way other than using the ValueConvert Event as you mention above.




David Hayden
Microsoft MVP C#
Jun 8, 2007 at 3:36 PM
don't you think that sending the VAB exceptions to the ValidationPerformed event would be a better design pattern?