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

Equal distance between tick marks

2 Answers 78 Views
Slider
This is a migrated thread and some comments may be shown as answers.
david
Top achievements
Rank 1
david asked on 29 Mar 2011, 12:10 AM
Hello,

I would like to have equal spacing between my tick marks, even though the values of my slider data aren't equally spaced.

For example, if I have a SelectionStart and End of 1 and 100, with distinct tick values of 10, 13, 20, 58, and 99,  I get a slider with 5 tick marks in the respective distance between 1 and 100. Instead, I would like to the 5 tick marks to be all equidistant within the slider.

Is there a way to do this?

Thanks,

David

2 Answers, 1 is accepted

Sort by
0
Accepted
Petar Mladenov
Telerik team
answered on 31 Mar 2011, 05:28 PM
Hello david,

You can use a TickValueConverter in your TickTemplate in order to convert the values 20,40,60,80 (for example, equal distance between them) into 10, 13, 20, 58. But this way the returned value of the slider will be wrong.


All the best,
Petar Mladenov
the Telerik team
0
david
Top achievements
Rank 1
answered on 31 Mar 2011, 06:20 PM
Thanks for the reply. I was considering that solution, but as you say, the values returned would be incorrect. 

Maybe I can keep a Dictionary around that has a tick mark=>real value pairing and I can grab the value I need when a tick mark is hit.

Thanks again.
Tags
Slider
Asked by
david
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
david
Top achievements
Rank 1
Share this question
or