Skip to main content

Validation

Validate user input before using it in your application. Wisej.NET provides control validation events, reusable validation rules, and error providers that display feedback beside the relevant field.

AutoValidate Mode​

AutoValidate controls implicit validation when focus moves between controls. Disable turns off implicit validation without preventing explicit calls to Validate() or ValidateChildren(). EnableAllowFocusChange permits focus to move even if validation fails; EnablePreventFocusChange prevents the move. Inherit uses the container's setting.

Validation Rules​

The Validation component associates reusable rules with controls and runs them through the Validating and Validated events. A failed rule sets the control's InvalidMessage and cancels validation. Use built-in rules for common checks or custom rules for application-specific requirements. See Validation Rules.

IErrorProvider​

IErrorProvider separates validation from the way errors are displayed. Assign an error provider to the Validation component to control where messages appear. The ErrorProvider component can show an error indicator, while a Label implementing the interface can display the message as text.