This is a migrated thread and some comments may be shown as answers.

Wizard implementation

2 Answers 81 Views
Wizard
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Iron
Paul asked on 07 Oct 2015, 05:00 AM

I  have a few questions on implementation. I haven't figured out approach yet. Basically, the scenario is that this is on a admin site, and that certain steps would load pending upon the roles the user has.

If I had the steps written explicitly and then have the removed from the server side, the fields in the removed steps would still technically be available on the on finish event, just not editable by the user, ​correct?

If I were to put them in user controls and add them dynamically from the codebehind, then with each one I would have to use a save button and use event bubbling described here: http://www.telerik.com/forums/refresh-wizard-from-usercontrol , correct?

If I had only one step on, it would determine that is the final step and hide the previous button, correct?

2 Answers, 1 is accepted

Sort by
0
MBEN
Top achievements
Rank 2
Veteran
answered on 19 Oct 2015, 09:52 PM
Is it possible to remove the previous button on Finish Step?
0
Ivan Danchev
Telerik team
answered on 22 Oct 2015, 04:36 PM
Hello,

I am afraid that if you remove a step it won't be available in the FinishButtonClick event handler, neither will be any of its content.
The event bubbling from the linked thread is a way to access the RadWizard's steps from a UserControl embedded in a step. If you want to add new steps and remove steps you don't necessarily have to use UserControls. This can be done conditionally (based on user role for instance) in the main page's code-behind as demonstrated in the Add / Remove WizardSteps demo.
As for the presence of the "Remove" button, it will appear depending on the step's StepType property value. It won't be present if the type is "Start" but will appear if the type is "Step" or "Finish" even if the Wizard contains only one step. If you want to hide it you can do so on the client in the Wizard's OnClientLoad client-side event handler for instance, where you can check the step type and if it is "Finish" hide the button. Here's how this can be done:
function OnClientLoad(sender) {
    var activeStep = sender.get_activeWizardStep();
    if (activeStep.get_stepType() == "2") {
        $(".rwzPrevious").hide();
    }
}
A value "2" returned by the get_stepType() method corresponds to a step of type "Finish". If the step is of this type you can get the button by its class with jQuery and hide it.

Regards,
Ivan Danchev
Telerik
Tags
Wizard
Asked by
Paul
Top achievements
Rank 1
Iron
Answers by
MBEN
Top achievements
Rank 2
Veteran
Ivan Danchev
Telerik team
Share this question
or