How can I validate cell contents before they are stored in the grid?

Article ID: 468
Last updated: 25 Apr, 2018
Article ID: 468
Last updated: 25 Apr, 2018
Revision: 4
Views: 1802
Posted: 10 Jan, 2001
by Meltreger B.
Updated: 25 Apr, 2018
by Meltreger B.

Problem


How can I validate cell contents before they are stored in the grid?


Cause



Action


You should either override OnValidateCell() or OnEndEditing().

OnValidateCell() is called only if the cell is marked modified. If you return FALSE the cell contents will not be stored in the grid and the user cannot navigate the current cell to a new position.

OnEndEditing() is called regardless whether a cell is marked modified or not. If you return FALSE the user cannot navigate the current cell to a new position.

Note that check boxes and radio buttons have no modified state. When the user clicks into a checkbox, the new value is stored immediately in the grid. Therefore OnValidateCell() will not be called. You should implement validation for check boxes in OnClickedButtonRowCol().

This article was:   Helpful | Not helpful
Report an issue
Article ID: 468
Last updated: 25 Apr, 2018
Revision: 4
Views: 1802
Posted: 10 Jan, 2001 by Meltreger B.
Updated: 25 Apr, 2018 by Meltreger B.

Others in this category