New to Telerik UI for Blazor? Download free 30-day trial

Requires the Max parameter error in Slider


Product Slider for Blazor


I'm using the Telerik Slider, and I can't set Max to 0. When I set the Max parameter to zero, the component throws an error.

Error Message

ArgumentException: Telerik.Blazor.Components.TelerikSlider`1[System.Int32] requires the Max parameter.

Possible Cause

The Max parameter is a required attribute and the component is checking if it is set. If the developer doesn't set any value for Max and the Slider Value type is int, then the Max parameter value will match the default value of the int type. This causes the observed error. The default value for the non-nullable int type is 0, and when you explicitly set Max to 0, the component acts like there is no parameter value set and still throws the error.


You can avoid the exception by using a nullable type for the Slider Value.

Set Max parameter to zero in the Slider

@* Example with nullable type of the value  *@
<br />
<TelerikSlider @bind-Value="@Volume"

    int? Volume { get; set; }
In this article