This is a migrated thread and some comments may be shown as answers.

Linked sliders that adjust together

1 Answer 42 Views
Slider
This is a migrated thread and some comments may be shown as answers.
Silviu
Top achievements
Rank 1
Silviu asked on 11 Oct 2019, 09:58 AM

Is it possible to have two sliders that adjust each other's values automatically client-side?

So both sliders have values 0 - 100 and if slider 1's value is adjusted to 60 then slider's value automatically becomes 40 (i.e. slider 2 value = 100 - slider 1 value and slider 1 value = 100 - slider 2 value)

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 16 Oct 2019, 08:05 AM

Hi Silviu,

 

Yes, of course - you can achieve this requirement using the following event handler provided by the slider control:
https://docs.telerik.com/devtools/aspnet-ajax/controls/slider/client-side-programming/events/onclientvaluechanged

Once you have the new value, you can subtract it from 100 and set the resulting value to the other related slider using the set_value() method:
https://docs.telerik.com/devtools/aspnet-ajax/controls/slider/client-side-programming/radslider-object

I hope this will prove helpful. Feel free to give it a try and let me know about the result.

 

Regards,
Eyup
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Slider
Asked by
Silviu
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or