Link to home
Start Free TrialLog in
Avatar of Joar
Joar

asked on

Removing wizardsteps in vb.net gives the error "Argument out of rabge exception"

I have 6 wizardsteps, represented as 6 buttons in the SideBar (not using Next and Previous buttons)
For some records in the db I do not need wizardstep 5 an 6
If I click on wizardstep 5 or 6 and then move to a record which doesn't need step 5 and 6, I do:
 wizardStep.RemoveAt(6)
 wizardStep.RemoveAt(5)

This gives the crash error "Argument out of range exception".
If I move to wizardstep 4, before moving on to changing record, things goes well
I hav tried all ways of workarounds I feel, with no success
Avatar of dericstone
dericstone
Flag of Germany image

It's not clear why you want to remove wizard steps. Don't you just want to skip over some?

In any case, I think the wizard steps are indexed with a base zero index. So index 6 might not exist - use indices 0 - 5. You can check this by calling IndexOf on the wizard steps you are interested in skipping.

If I'm not helping here, please post some code.
Avatar of Joar
Joar

ASKER

No, I want to remove the steps, because they are meaningless for some records.
I know about the zero based step index, so in the example above I ment to remove steps 4 and 5...

May be I should use another technique than wizardsteps, for example multiview??
The only thning I want is having some buttons in the left margin.
Clicking on different buttons, I want to display different windows in the right part of the page.

ASKER CERTIFIED SOLUTION
Avatar of Joar
Joar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial