I'm working on setting up windows forms validation with:
Validator class
Dependency Injection
BindingSource
ErrorProvider
Scenario: Single Entity with Textboxes bound to properties
Disclaimer: I'm a windows forms noob, most of my experience is with web technologies
Should I be calling
involvedEntity.SetEntityFieldError
or
throw new ORMEntityValidationException
inside the ValidateFieldValue override when there is an invalid value?
If I just set the entity error the user is still allowed to navigate to other textboxes, if I throw the exception they are not.
Another question. If I throw the exception while editing a textbox (so i'm locked into the text box) I thought that simply hitting the escape key was supposed to roll back the value and allow you to "leave" the control. I am not getting this result and was wondering if I'm doing something wrong, or expecting something that just doesn't happen.
Thanks in advance for any comments/suggestions.