Move to next steps in code (RadzenSteps)

Hi :slight_smile:
I am using RadzenSteps with two steps.

I want to implement my own "next" button. But I don't get it to work, that the next step is being activated. Several options did not work. It seems, that the app isn't notified. The click event works as there appears the notification. Do you have an idea?

This is what I have tried so far (also each separated):

protected async System.Threading.Tasks.Task Button0Click(Microsoft.AspNetCore.Components.Web.MouseEventArgs args)
        {
            step1.Selected = false;
            step2.Selected = true;
            steps.NextStep();
            steps.SelectedIndex = 1;
            InvokeAsync(StateHasChanged); 
            
            this.NotificationService.Messages.Add(new NotificationMessage{Summary="Test"});
        }

Thanks upfront, Markus

In general we don't recommend setting properties of components directly as this rarely updates the UI and is against the Blazor declarative nature. What you should do instead is create a property that stores the selected index and update it instead. Then use @bind-SelectedIndex so it is kept in sync.

<RadzenSteps @bind-SelectedIndex="@selectedIndex">

void Button0Click()
{
  selectedIndex = 1;
}

Thanks! Works exactly as you described :slight_smile:

Thank you a lot!