New to Telerik UI for ASP.NET MVC? Download free 30-day trial

Making the Wizard Stepper Stick to the Top of the Page

Environment

Property Value
Product Wizard for ASP.NET MVC
Version 2023.3.1114

Description

I want to make the stepper in the Wizard for ASP.NET MVC component stick to the top of the page when scrolling, as some forms can be quite long.

Solution

To achieve this, follow these steps:

  1. Add an empty <span> element with a unique ID above the Wizard component:
<span id="customWrapper"></span>
  1. In the JavaScript code, detach the stepper element and append it to the empty <span> element:
$(document).ready(function () {
    var stepper = $('.k-stepper').detach();
    $("#customWrapper").append(stepper);
    $('.k-stepper').data("kendoStepper").setOptions({});
});
  1. Apply CSS to make the custom <span> element sticky and visible at the top:
#customWrapper {
    position: sticky;
    top: 0;
    z-index: 100;
}
  1. (Optional) If you want to add a background color to the stepper, use the .k-stepper CSS class selector:
.k-stepper {
    background-color: green;
}

More ASP.NET MVC TextBox Resources

See Also

In this article