|| | |||Browse by category|
How do I avoid validation when the user hits cancel?
Calling OnValidate() from a WM_KILLFOCUS message handler is not correct because there is no way to detect what kind of button the user has clicked on.
What you should do when you are using the grid in dialogs is:
- Call DDV_GXGridWnd in DoDataExchange()
- Whenever grid data should be validated, call UpdateData().
During OnOK(), UpdateData() is called by default, but if you want to validate the grid whenever you click on another control in your dialog, you should create a notification that another control has gained focus and then call UpdateData(). This will update the grid and will also be able to set back the focus to the grid.