Is It Possible to Use a Telerik Form and Razor Views in Seperate Steps in a Telerik Wizard?

1 Answer 26 Views
Wizard
Tyler
Top achievements
Rank 1
Tyler asked on 08 Dec 2024, 08:46 PM

Let's say I have a Telerik Wizard With Three Steps and I am passing a View Model to each step. In Step 1, A Telerik Form component would suffice. But, In Step 2, I need to have more specific control over the layout and function than what the Form Component provides. I would like to use custom MVC Razor View syntax for Step 2, for example:

 <div class="form-group">
                <label asp-for="Title" class="control-label"></label>
                <input asp-for="Title" class="form-control" />
                <span asp-validation-for="Title" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="Rating" class="control-label"></label>
                <input asp-for="Rating" class="form-control" />
                <span asp-validation-for="Rating" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="ReleaseDate" class="control-label"></label>
                <input asp-for="ReleaseDate" class="form-control" />
                <span asp-validation-for="ReleaseDate" class="text-danger"></span>
            </div>

Is this something that is possible and would I preserve the View Models state between steps? I'm not exactly finding a clear solution in the documentation. Any help or an example of how this could be done would be appreciated!

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 10 Dec 2024, 02:03 PM

Hi Tyler,

 

Thank you for contacting us.

There are various ways of achieving this requirement:

1. Wizard with Form integration:
https://demos.telerik.com/aspnet-core/wizard/form

    @(Html.Kendo().Wizard()
        .Name("wizard")
        .Events(ev => ev.Done("onDone"))
        .Tag("form")
        .HtmlAttributes(new { @novalidate ="" })
        .Steps(s =>
        {
            s.Add()
            .Title("Registration")
            .Form(f => f
And then you can implement templated Form items:
https://demos.telerik.com/aspnet-core/form

                    i.Add()
                        .Field(f => f.Password)
                        .Label(l => l.Text("Password:"))
                        .Hint("Hint: enter alphanumeric characters only.")
                        .EditorTemplateHandler("setPasswordEditor");

2. Stepper component:
https://demos.telerik.com/aspnet-core/stepper

3. Wizard with Partial views:
https://demos.telerik.com/aspnet-core/wizard/ajax

4. Wizard with Template component integration:
https://demos.telerik.com/aspnet-core/template

Do you find this reply to be helpful? Let me know which option you like the most.

 

Regards,
Eyup
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.

Tags
Wizard
Asked by
Tyler
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or