Objective Grid: Preventing validation when the hits cancel

Article ID: 722
Last updated: 11 Jun, 2018
Article ID: 722
Last updated: 11 Jun, 2018
Revision: 3
Views: 1505
Posted: 09 Jan, 2001
by Meltreger B.
Updated: 11 Jun, 2018
by Meltreger B.

Problem


How do I avoid validation when the user hits cancel?


Cause



Action


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:

  1. Call DDV_GXGridWnd in DoDataExchange()
  2. 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.

This article was:   Helpful | Not helpful
Report an issue
Article ID: 722
Last updated: 11 Jun, 2018
Revision: 3
Views: 1505
Posted: 09 Jan, 2001 by Meltreger B.
Updated: 11 Jun, 2018 by Meltreger B.

Others in this category