WizardControl.PrevClick Event
Fires after the Back button has been clicked and allows you to cancel the operation.
Namespace: DevExpress.XtraWizard
Assembly: DevExpress.XtraWizard.v24.1.dll
NuGet Package: DevExpress.Win
Declaration
Event Data
The PrevClick event's data class is WizardCommandButtonClickEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
Handled | Gets or sets whether an event was handled. |
Page | Gets the processed wizard page. Inherited from WizardPageEventArgs. |
Remarks
By default, clicking the Back button automatically navigates an end-user to the previous wizard page within the WizardControl.Pages collection. Once clicked, the PrevClick event is raised, which allows you to cancel the operation by setting the WizardCommandButtonClickEventArgs.Handled parameter to true. The current page is returned by the event parameter’s WizardPageEventArgs.Page property.
To learn more, see Page Events.
Example
In the following sample, a Wizard Control has 5 pages:
- a Welcome Page
- an Interior Page with a RadioGroup editor that offers three navigation options: Page 3, Page 4, or the final completion page;
- two more Interior Pages: Page 3 and Page 4;
- a Completion Page.
The code below illustrates how to navigate to a correct page depending on a choice a user makes in the second page.
bool pageSkipped = false;
private void wizardControl1_NextClick(object sender, DevExpress.XtraWizard.WizardCommandButtonClickEventArgs e)
{
if (e.Page == wizardPage1)
{
switch (radioGroup1.EditValue.ToString())
{
case ("ToPage2"):
wizardControl1.SelectedPage = wizardPage2;
e.Handled = true;
break;
case ("ToPage3"):
wizardControl1.SelectedPage = wizardPage3;
e.Handled = true;
pageSkipped = true;
break;
case ("ToFinalPage"):
wizardControl1.SelectedPage = completionWizardPage1;
e.Handled = true;
pageSkipped = true;
break;
}
}
}
private void WizardControl1_PrevClick(object sender, DevExpress.XtraWizard.WizardCommandButtonClickEventArgs e)
{
if (pageSkipped)
{
wizardControl1.SelectedPage = wizardPage1;
pageSkipped = false;
e.Handled = true;
}
}