How to change Active Wizard from Client Side Script

2 posts, 0 answers
  1. Yahya
    Yahya avatar
    1 posts
    Member since:
    Aug 2016

    Posted 11 Aug Link to this post

    Hi Guys,

    I spend lots of time but unable to success to skip the wizard step based on condition. I used differernt techniques but didn't get success kindly guide me. I just want to skip some steps based on certain condition.

    Using: 

                function changeActiveIndex(gotoIndex) {
                    var wizard = $find("<%= RadWizard1.ClientID %>");
                    wizard.set_activeIndex(gotoIndex);
                    //wizard.set_activeWizardStep = wizard.get_wizardStepByIndex(2);
                }

  2. Ivan Danchev
    Admin
    Ivan Danchev avatar
    834 posts

    Posted 12 Aug Link to this post

    Hello Yahya,

    Here's an example how you can skip a step conditionally. In this case the condition is whether the user has clicked the Next button (in that case args.get_command() will return "1" in the OnClientButtonClicked event handler):
    <script type="text/javascript">
        function OnClientButtonClicked(sender, args) {
            var command = args.get_command();
            if (command == "1") {
                var activeIndex = sender.get_activeIndex();
                if (activeIndex > 0) {
                    sender.set_activeIndex(activeIndex + 1)
                }
            }
        }
    </script>
    <div>
        <telerik:RadWizard ID="RadWizard1" runat="server" OnClientButtonClicked="OnClientButtonClicked">
            <WizardSteps>
                <telerik:RadWizardStep ID="RadWizardStep1" runat="server" Title="Step 1">
                </telerik:RadWizardStep>
                <telerik:RadWizardStep ID="RadWizardStep2" Title="Step 2" runat="server" StepType="Step">
                </telerik:RadWizardStep>
                <telerik:RadWizardStep ID="RadWizardStep3" Title="Step 3" runat="server" StepType="Step">
                </telerik:RadWizardStep>
                <telerik:RadWizardStep ID="RadWizardStep4" Title="Step 4" runat="server" StepType="Step">
                </telerik:RadWizardStep>
                <telerik:RadWizardStep ID="RadWizardStep5" runat="server" Title="Step 5" StepType="Finish">
                </telerik:RadWizardStep>
            </WizardSteps>
        </telerik:RadWizard>
    </div>


    Regards,
    Ivan Danchev
    Telerik by Progress
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top