Click or drag to resize

DataWindow.PreValidate Method (Typed)

X#
Called after any status change in this data window to allow controls and menu commands to be enabled/disabled based on the current validation status.

Namespace:  XSharp.VO.SDK
Assembly:  XSharp.VOGUIClasses (in XSharp.VOGUIClasses.dll) Version: 2.19
Syntax
 VIRTUAL METHOD PreValidate() AS USUAL
Request Example View Source

Return Value

Type: Usual
Remarks
Tip Tip
Important! This is a callback method used by X#. Normally, it should not be called in your application code.
This method provides some of the functionality of the WHEN clause in classical Xbase @...SAY...GET statements. However, since the GUI approach does not enforce a rigid sequence of data entry but allows the user to move from control to control at random, the logic of enabling and disabling controls must be different. Instead of checking a condition when focus switches into the control (this is too late, a user with a mouse is already on the new control), the system must keep checking on every significant event. DataWindow:Prevalidate() provides some automatic handling of this type of validation (through DataWindow:RegisterConditionalControls()), but it also allows you to insert custom logic by overriding the method. The standard action in DataWindow:Prevalidate() is to call DataWindow:EnableConditionalControls(); if problems exist, it calls DataWindow:DisableConditionalControls(). DataWindow:Prevalidate() is called after the application of the standard validation, allowing the user to replace the default handling, upon success or failure of validation.
See Also