We help IT Professionals succeed at work.

Hide Show Step on Wizard Conteol

patelajk
patelajk asked
on
Medium Priority
1,095 Views
Last Modified: 2012-05-06
Hi

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


Comment
Watch Question

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

ActiveStepChanged event
 

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

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
Step 4  = "HAS STEP TYPE COMPLETE"
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
				wizSecSellerReg.WizardSteps.Remove(wizSecSellerReg.WizardSteps(2))
			End If
 
			If chkNewletter.Checked = True And chkTrials.Checked = False Then
				wizSecSellerReg.ActiveStepIndex = 2
				wizSecSellerReg.WizardSteps.Remove(wizSecSellerReg.WizardSteps(1))
			End If
 
			If chkNewletter.Checked = False And chkTrials.Checked = False Then
				wizSecSellerReg.WizardSteps.Remove(wizSecSellerReg.WizardSteps(1))
				wizSecSellerReg.WizardSteps.Remove(wizSecSellerReg.WizardSteps(2))
			End If
		End If
	
	End Sub

Open in new window

Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.