New to Telerik UI for .NET MAUI? Start a free 30-day trial

.NET MAUI RangeSlider Events

The Telerik UI for .NET MAUI RangeSlider component exposes a RangeChanging event which is raised when the end user drags the start/end thumb or the range track. You can use this event to plug custom logic by changing the RangeStart or RangeEnd properties.

The RangeChanging event handler receives two parameters:

  • The sender argument, which is of type object, but can be cast to the RadRangeSlider type.
  • A RangeChangingEventArgs object, which provides RangeStart and RangeEnd properties of the RangeSlider.

The following example demonstrates how to use the RangeChanging event to prevent dragging the start/end thumbs in case the range is less than 20:

1. Define the RangeSlider:

<telerik:RadRangeSlider Minimum="0"
                        RangeChanging="RangeSlider_RangeChanging" />

2. Add the event handler:

private void RangeSlider_RangeChanging(object sender, Telerik.Maui.RangeChangingEventArgs e)
    var rangeSlider = (RadRangeSlider)sender;
    if((e.RangeEnd - e.RangeStart) < 20)
        e.RangeStart = rangeSlider.RangeStart;
        e.RangeEnd = rangeSlider.RangeEnd;

See Also

In this article