I have a RadDataForm, with a DataFormDataField, that is bound to a Decimal property.
I'm trying to get validation working, and I'm having some issues:
I'm trying to get validation working, and I'm having some issues:
- When I have a validation error, and the DataFormDataField does not have its Label property set, the error is displayed using the name of the field, instead of the [Display(Name="xxx")] annotation.
- When I enter invalid characters (non-numeric), my Decimal property's setter is never called, instead the form displays a "Value 'xxx' could not be converted" error. I need to display a more meaningful message.
- I have a listener on the RadDataForm's ValidatingItem event - but that event is not called when I move focus from one field to another (which is when the above error messages appear.)
- I need to some level of validation on each keystroke. If the field can only hold 12 characters, an attempt to type a 13th should do nothing. If the user is typing in a field that can only hold numeric values, typing non-numeric characters should do nothing - the keyboard event should be swallowed, and the character should not appear in the field. At a minimum, letters would be filtered, it'd be better if we could look at the new character and the existing content, and decide whether the new character can be applied without invalidating the field. (If the field is bound to a decimal, it should allow numbers, and one decimal point. A second decimal point should be swallowed.)