Wizard MoveTo() method

C

Craig Buchanan

I'm using the Wizard control in the 2.0 framework. I need to perform a
validation on each of the steps of the wizard in the Finish button click
event. This scenario would occur if the user clicked the Finished
navigation link, then the Finish button, bypassing the validation that
occurs on each page.

In the Finish button's click event, I perform the validation of the previous
pages. I would like to go to the first page with invalid data using the
MoveTo() method. The code in the Finish button resembles:

If Not UserControl.IsValid Then
e.Cancel = True
Me.Wizard1.MoveTo(Me.Wizard1.WizardStep2)
Exit Sub
End If

The MoveTo() method does move to the desired step and the ActiveStepChanged
event fires. Unfortunately, after the Exit Sub line, the ActiveStepChanged
event fires again, where the ActiveStepIndex is the Finished page. Moving
the e.Cancel line after the MoveTo() doesn't have an effect.

What am I missing?

Thanks in advance.

Craig Buchanan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,981
Messages
2,570,188
Members
46,733
Latest member
LonaMonzon

Latest Threads

Top