Wizard Control and Removing Steps

S

skardian

I have a created a wizard control that has a total of 21 steps. On the
first step the user can determine how many of the following 20 steps
they actually need. In a case in which the user needs only 4 steps the
code behind removes to other 16 steps that are no longer nessecary.
This all works and I can remove any number of steps and see the finish
button on the last needed step.

Here is my problem. If I tell the control that I only need 4 sub-steps,
I get a finish button on the 4th and final sub-step (as I had wanted).
However clicking the finish button yields me this error:

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

Anyone have any ideas what is causing this? I am not changing the step
type, as they are all wizardsteps. However I am sure it has something
to do with the removing of the steps.

For additional clarification I am removing the steps using the
following code:

for (int i = createTaskWizard.WizardSteps.Count - 1; i >
Convert.ToInt32(txtNumberofSubs.Text); i--)
{
if (i > Convert.ToInt32(txtNumberofSubs.Text))
{

createTaskWizard.WizardSteps.Remove(createTaskWizard.WizardSteps);
}
}

I had to start at the last step and move forward in order to not have
an additional unwanted step.
 

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,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top