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

Finding Wizard Steps/Accessing buttons

5 Answers 541 Views
Wizard
This is a migrated thread and some comments may be shown as answers.
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
Albert Shenker asked on 25 Dec 2015, 02:07 PM

Wizard Steps should have a "Value" or other similar property so that they can be located server and client side by something other than title and/or index using a FindByValue method. Wizard Step titles and indices can be easily changed as the Wizard is modified, thus breaking any code that makes use of title or indices to get a reference to a step.

Also, and it has been repeated elsewhere, users need to be able to access the Wizard navigation buttons server-side in order to manipulate them (text, enabled/disabled, visibility, etc.). I'm not really sure why such basic functionality wasn't part of the initial release of the control. I mean, why would you release a control that provides a number of features which improve on the existing ASP.NET Wizard control, and yet is missing a bunch of important features that the ASP.NET Wizard control has. It just puts developers in a bind, having to decide whether or not to invest the time and energy of figuring out how to implement your control, only to find that they can't do some basic thing after investing that time.

5 Answers, 1 is accepted

Sort by
0
Hristo Valyavicharski
Telerik team
answered on 25 Dec 2015, 02:17 PM
Hi Albert,

You can work with the Steps as access them by ID. For example:
<telerik:RadWizard runat="server" ID="wizard">
          <WizardSteps>
              <telerik:RadWizardStep ID="step1" Title="Step 1"></telerik:RadWizardStep>
          </WizardSteps>
      </telerik:RadWizard>

protected void Page_Load(object sender, EventArgs e)
    {
        step1.Title = "New Title";
        step1.Enabled = false;
    }


Regards,
Hristo Valyavicharski
Telerik
0
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
answered on 25 Dec 2015, 02:31 PM

will the findcontrol method work then in order to get a reference to the step by a string... like... CType(MyWizard.FindControl("step1"), RadWizardStep)?

 

Also, will $get('<%= step1.ClientId%>') work to reference the step client-side?

0
Hristo Valyavicharski
Telerik team
answered on 25 Dec 2015, 02:48 PM
Yes the FindControl method will work. However to step reference you will have to use the control client api:
<script type="text/javascript">
    function getStepById(id) {
        var wizard = $find("wizard");
        var steps = wizard.get_wizardSteps();
        for (var i = 0; i < steps.get_count() ; i++) {
            var step = steps.getWizardStep(i);
            if (step.get_id() == id) {
                return step;
            }
        }
    }
</script>


Regards,
Hristo Valyavicharski
Telerik
0
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
answered on 25 Dec 2015, 02:55 PM

ok. By the way the step.get_id() function is not documented.

Also, it would be useful if the wizard or wizardstepcollection objects had a findStepById method.

0
Hristo Valyavicharski
Telerik team
answered on 25 Dec 2015, 03:13 PM
Thank you for point this out. We will add this, or you can add it by yourself as you click on the Edit button:


It is a great idea to add "findStepById" functionality. Please submit it to our Feedback Portal.

Thank you.

Regards,
Hristo Valyavicharski
Telerik
Tags
Wizard
Asked by
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
Answers by
Hristo Valyavicharski
Telerik team
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
Share this question
or