• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1072
  • Last Modified:

Hide Show Step on Wizard Conteol


I have a Wizard control and am having trouble hiding some steps depending on what was selected on the first step.

Basically There are 3 steps Step 1, Step 2, Step 3

On Step 1 there are 2 checkboxes ---  chkStep2  and chkStep3

If None of the checkboxes are selected then step 2 and 3 are hidden

If Only chkStep2 is checked and chkStep3 is not checked then only Step 2 is viisible and has a step type of "Finish"

If Only chkStep3 is checked and chkStep2 is not checked then only Step 3 is viisible and has a step type of "Finish"

If both are checked then both steps 3 and step 2 are visible

The "if"  statement is stright forward I am just not sure on what event on the wizard i need to put it on

Thanks for your help

1 Solution
       don't try to hide.
based on the first step condition
navigate directly to the step what you want
using the

ActiveStepChanged event
patelajkAuthor Commented:
Used this code but it doesnt hide corretly and i get this error on some occasions:

The command 'MoveComplete' is not valid for the previous step, make sure the step type is not changed between postbacks      

Step 1 = Details
Step 2 = Trial
Step 3 = NewsLetter
Private Sub Wizard1_NextButtonClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) Handles wizSecSellerReg.NextButtonClick
		If wizSecSellerReg.ActiveStepIndex = 0 Then
			If chkNewletter.Checked = False And chkTrials.Checked = True Then
				wizSecSellerReg.ActiveStepIndex = 1
			End If
			If chkNewletter.Checked = True And chkTrials.Checked = False Then
				wizSecSellerReg.ActiveStepIndex = 2
			End If
			If chkNewletter.Checked = False And chkTrials.Checked = False Then
			End If
		End If
	End Sub

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now