Klick Event on RadSlider

1 Answer 51 Views
ScheduleView Slider
Romano
Top achievements
Rank 1
Romano asked on 25 Jan 2023, 10:18 AM

Hello Im Working with the RadSlider in the RadScheduler.

 

I've used the RadSlider_OnDragDelta Method to change the view definition. Works as intended atm.

But I've got a problem. If somebody just klicks on the slider (left or right of the Darg-Bar) to make the Bar hop on that spot, the event doesn't get fired.

So I've found several events if somebody drags the silider. But what if somebody just klick on the Slider?

Is there a event i can catch this behaviour?

best regards

1 Answer, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 30 Jan 2023, 08:49 AM

Hello Romano,

Although we already discussed this in the private support ticket you opened, I'm also sharing the proposed and final solutions here in case someone else finds them beneficial:

"What I can suggest given this information would be to instead handle the ValueChanged event of the RadSlider control. This way, you will mimic more closely the approach demonstrated in the Configurator demo and the event is also fired when clicking on the slider bar.

private void RadSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
        {
            if (this.ScheduleView != null && this.ScheduleView.ActiveViewDefinition != null)
            {
                this.ScheduleView.ActiveViewDefinition.MinTimeRulerExtent = e.NewValue;
            }
        }

And here is the final solution that was adopted:

            var slider = (RadSlider)sender;
            if (RadScheduleView != null && RadScheduleView.ActiveViewDefinition != null)
            {
                RadScheduleView.ActiveViewDefinition.VisibleDays = (int)slider.Value;
                RadScheduleView.ActiveViewDefinition.LargeChangeInterval = new DateTimeInterval((int)slider.Value, 0);
            }

I hope this is helpful.

Regards,
Dilyan Traykov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
ScheduleView Slider
Asked by
Romano
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Share this question
or