I have a simple Windows Form with an ErrorProvider and BindingDataSource setup just like the examples that is used to create a new instance of my BO or to edit an existing one - same form for both purposes.
When I load the form and don't pass in the BO, it creates a new, empty BO and binds the form to it (using the BindingDataSource). My BO has a handful of validation rules including a couple StringRequired rules. These fields are empty by default. As a result, when the form is loaded, I am immediately greeted with the blinking exclamation point telling me that an error exists. I shouldn't see this until I try to do something that will cause validation to occur.
I can't figure out what is triggering validation on my BO when the form first loads. Any ideas?
The easiest way to do this is to do the following (general steps):
This will prevent any "real" rules from running if the object shouldn't evaluate those rules.
Copyright (c) Marimer LLC