is not a valid value for Int32

Topics: Validation Application Block
Oct 12, 2007 at 8:17 PM
I had a nasty problem when trying to use the Validation Provider on my winforms app using Dev Express controls. Whenever I used the Range Validator I got a completely user-hostile error message saying " is not a valid value for Int32" (notice the space at the beginning) as the error in my dev express error provider. It turns out that if you do not specify a value for both the UpperBound and LowerBound, the Range Validator will throw and exception and the Dev Express validation integration swallows up the error and presents it as though it is a validation failure.

The fix is to configure a both UpperBound and LowerBound and set their type to "Ignore" if you want the bound ignored.