WizardControl.SelectedPageChanging Event
Enables you to control whether a wizard page can be selected.
Namespace: DevExpress.XtraWizard
Assembly: DevExpress.XtraWizard.v24.1.dll
NuGet Package: DevExpress.Win
Declaration
Event Data
The SelectedPageChanging event's data class is WizardPageChangingEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
Cancel | Gets or sets whether the operation must be canceled. |
Direction | Gets a value that indicates in which direction a user navigates between pages. Inherited from WizardPageChangedEventArgs. |
Page | Gets or sets the current wizard page. |
PrevPage | Gets the previously active wizard page. Inherited from WizardPageChangedEventArgs. |
Remarks
The SelectedPageChanging event is raised when a new page is about to be selected. This occurs when an end-user clicks the Next or Back button, or the page is selected in code.
Within the SelectedPageChanging event handler you can do the following:
- cancel the operation by setting the WizardPageChangingEventArgs.Cancel property to true;
- initialize settings of the newly selected wizard page, which is returned by the WizardPageChangingEventArgs.Page property;
- implement custom navigation (plot-branched navigation). Use the WizardPageChangingEventArgs.Page property to select the required wizard page. The previously selected page is returned by the WizardPageChangedEventArgs.PrevPage property. To obtain the direction in which a user navigates between wizard pages, use the Direction property.
To learn more, see Page Events.
private void wizardControl1_SelectedPageChanging(object sender,
DevExpress.XtraWizard.WizardPageChangingEventArgs e) {
if(e.Page == wpLongText)
e.Page.AllowNext = ceLongText.Checked;
if(e.PrevPage == wpQuestion && e.Direction == Direction.Forward)
if(ceYesAnswer.Checked) e.Page = wpProgress;
if(e.PrevPage == wpProgress && e.Direction == Direction.Backward)
e.Page = wpQuestion;
}
See Also