How can i set SelectIndex value to next step only after form validation is satisfied

I'm using selectIndex to move programmatically to next step
image
by using ref ,i'm moving next ,but this creates a problem when validation comes into picture, It doesn't validate the forms and move next. But the next button provided by radzen steps validate each step item .
How can i achieve this in my custom button , which i will call the above method to move next step.

Hi @Sree_Vishnu_S,

You shouldn't set any properties of Blazor components via refs. This will rarely work. Instead set their properties declaratively and update them accordingly:

<RadzenSteps SelectedIndex=@selectedIndex>
@code {
  void move() {
    selectedIndex = 1;
  }
}

In addition the RadzenSteps will automatically perform validation if put inside a RadzenTemplateForm component.

But if I use the above mentioned code ,by calling the method in button(code given below) it will not perform any validation . and aslo while selecting the textbox or dropdown of the forms , it will randomly move to other step items.

button code:
RadzenButton Text="Add Sync" ButtonType="ButtonType.Button" Click="move"

I don't see any code. By the way the validation code is here: https://github.com/radzenhq/radzen-blazor/blob/master/Radzen.Blazor/RadzenSteps.razor#L246