Rowvalidating e cancel couples dating com
08-Apr-2018 04:53
This was fixed by the following in the cancel button click event: Setting Causes Validation to false is the key, however this alone is not enough.
If the buttons parent has Causes Validation set to true, the validating event will still get called.
This example requires that a Text Box and Error Provider control have been created on a form.
Canceling this event cancels the changes to the current cell.
In one of my cases I had a cancel button on a panel on a form, so I had to set Causes Validation = false on the panel as well as the form.
In the end I did this programatically as it was simpler than going through all the forms...
The validation triggers a messagebox which is always shown even if the user wants to cancel editing/adding an object because the validating happens before the button-click.
I've even tried to set for the cancel button and all the parents of the cancel button. It seemed that if the user was in the middle of editing a field that was using validation and just decided to give up (leaving the field with an invalid input), the cancel button event was being fired but the window would not close down.
For more information about handling events, see NIB: Consuming Events.However, if the failing validation is preventing the cancel button from doing its thing, set the @Daniel Schaffer: i'm not sure if I understand the "however"-part correctly.