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

Display the current values

1 Answer 48 Views
Slider
This is a migrated thread and some comments may be shown as answers.
Jugoslav
Top achievements
Rank 1
Jugoslav asked on 12 May 2014, 12:52 PM
May i use a range slider as shown on the attached image?
Meaning both buttons should display their current position/value. 

Thank you

1 Answer, 1 is accepted

Sort by
0
Accepted
Slav
Telerik team
answered on 12 May 2014, 03:49 PM
Hello Jugoslav,

The RadSlider does not provide such functionality out-of-the-box, nevertheless it should be possible to achieve it by customizing the control a bit.

First you can use the OnClientValueChanged event of the slider in order to track the changes in the values of the two drag handles: http://demos.telerik.com/aspnet-ajax/slider/examples/clientsideevents/defaultcs.aspx

Then you can customize the appearance of the slider by creating a custom skin. You can check several examples in the following demo: http://demos.telerik.com/aspnet-ajax/slider/examples/customskins/defaultcs.aspx.

Finally, the client-side object of the slider has a function get_dragHandles() that returns an array with the HTML elements of the slider's drag handles. When you have the elements of the handles, you can display the values within via JavaScript, for example by using innerHTML.
var dragHandles = $find("<%= RadSlider1.ClientID %>").get_dragHandles(); // RadSlider1 is the ID of the slider control

Regards,
Slav
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Slider
Asked by
Jugoslav
Top achievements
Rank 1
Answers by
Slav
Telerik team
Share this question
or