Back to Devexpress

BaseWizardPage.PageValidating Event

windowsforms-devexpress-dot-xtrawizard-dot-basewizardpage-95c4726e.md

latest3.1 KB
Original Source

BaseWizardPage.PageValidating Event

Enables you to specify whether page data is valid, and whether the page can be switched.

Namespace : DevExpress.XtraWizard

Assembly : DevExpress.XtraWizard.v25.2.dll

NuGet Package : DevExpress.Win

Declaration

csharp
public event WizardPageValidatingEventHandler PageValidating
vb
Public Event PageValidating As WizardPageValidatingEventHandler

Event Data

The PageValidating event's data class is WizardPageValidatingEventArgs. The following properties provide information specific to this event:

PropertyDescription
DirectionGets whether the next or previous page is about to be activated.
ErrorIconTypeGets or sets the type of icon displayed within an error message.
ErrorTextGets or sets the error text displayed within the error message box.
ValidGets or sets whether the processed wizard page is valid.

Remarks

The PageValidating event is raised when the page is about to be switched, and allows you to specify whether its data is valid.

If page data is invalid, set the WizardPageValidatingEventArgs.Valid property to false. In this instance, the error message is displayed. Its text can be specified using the WizardPageValidatingEventArgs.ErrorText property. The page cannot be switched until it is valid.

csharp
private void wizardPage1_PageValidating(object sender, WizardPageValidatingEventArgs e) {
    e.Valid = IsValidLogin(teCustomerID.Text, tePswd.Text);
    if (!e.Valid)
        e.ErrorText = "The login information you supplied is not valid.";
}

The image below shows the result:

See Also

CancelButtonCausesValidation

HelpButtonCausesValidation

PreviousButtonCausesValidation

BaseWizardPage Class

BaseWizardPage Members

DevExpress.XtraWizard Namespace