So before saving data, I want to validate whether all the required fields are filled (Text Boxes) by the user. I would rather use a generic function that would be passed each control on the form and based on the type of the control, separate validation logic would be written.
Sure enough, clicking OK or pressing the Enter key will run the Validating event I wired up to the Text Box.
When you display data entry functionality to users, you frequently have to validate the data entered into your form.
The Data Grid View class provides a convenient way to perform validation before data is committed to the data store.
Is there any way of making the Escape key perform as intended, i.e. I just saw this problem as I was hunting a solution for the same and the override of Processdialog Key is the MS-approved solution until they fix the bug (Escape should do the same as clicking Cancel).
not raise the Validating event, just as if the Cancel button had been pressed? A discussion of this bug is also found here (just working with Visual Basic instead of C#.