Completed
Last Updated: 01 Mar 2024 08:15 by ADMIN
Release 2024 Q2 (May)
Chris
Created on: 12 Jul 2021 13:17
Category: Wizard
Type: Bug Report
5
Wizard with only one step causes "ArgumentException: The "Max" value should be greater than 0."

When you try to use Wizard with only one step inside, the following error appears:

"ArgumentException: The "Max" value should be greater than 0."

If you have more than one step, everything works as expected.

 

----------ADMIN EDIT-----------

To avoid the exception, you can use at least two steps inside the Wizard.

2 comments
ADMIN
Joana
Posted on: 15 Oct 2021 08:48

Hi,

Thank you so much for sharing your reproduction code as well and the workaround. The issue stems from the underlying progressbar used for rendering the progress between steps.

Regards,
Joana
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tech
Posted on: 10 Oct 2021 16:30

We have encountered this bug also, even though we always have more than one step.  However, our steps are created dynamically.  The bug appears to be some sort of race condition when the page is being rendered.  We put inthis code to get around the race condition:

        <TelerikStepper Orientation="StepperOrientation.Vertical"
                        StepType="StepperStepType.Labels"
                        ValueChanged="@OnStepChange"
                        Value="@CurrentStepIndex">
            <StepperSteps>
                @{ // There is a bug in the TelerikStepper control that causes a
                    // crash "ArgumentException: The 'Max' value should be greater than 0'.  The crash occurs if there
                    // are zero or 1 steps defined.  What follows is a hack to get around that bug.
                    if (Data == null || Data.Count == 0)
                    {
                        <StepperStep Text="AA">
                            <Template>
                                <div>Step A</div>
                            </Template>
                        </StepperStep>
                        <StepperStep Text="B">
                            <Template>
                                <div>Step B</div>
                            </Template>
                        </StepperStep>
                    }   // End of hack
                }
                @foreach (BpWizardStep step in Data)
                {
                    <StepperStep Class="@GetStepClass(step)">
                        <Template>
                            <div>
                                @step.Label
                            </div>
                        </Template>
                    </StepperStep>
                }
            </StepperSteps>
        </TelerikStepper>