Equal distance between tick marks

3 posts, 1 answers
  1. david
    david avatar
    4 posts
    Member since:
    Jan 2011

    Posted 28 Mar 2011 Link to this post

    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. Answer
    Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 31 Mar 2011 Link to this post

    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
  3. DevCraft banner
  4. david
    david avatar
    4 posts
    Member since:
    Jan 2011

    Posted 31 Mar 2011 Link to this post

    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.
Back to Top