Retrive click on slider position

4 posts, 1 answers
  1. David
    David avatar
    18 posts
    Member since:
    Dec 2010

    Posted 02 Jan 2011 Link to this post

    Hello,

    I wanted to know how can I make the slider thumb to jump to the position where I click on the slider. In other words, how can I retrieve the value where the user clicked on the slider (and then I could set the slider's value).

    Thank you
  2. Answer
    Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 03 Jan 2011 Link to this post

    Hi David,

    In order to move the thumb with one mouse click only, you can set IsMoveToPointEnabled="True".
    Feel free to ask if you need further assistance.

    Best wishes,
    Petar Mladenov
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for WPF
  3. UI for WPF is Visual Studio 2017 Ready
  4. Peter
    Peter avatar
    37 posts
    Member since:
    Dec 2011

    Posted 13 Dec 2011 Link to this post

    I cannot see any difference, no matter if I set IsMoveToPointEnabled to true or false. In any case the thumb moves to the position that I clicked on.

    Is there an event, that is fired when I click on the slider and the thump moves to that position? Or do I have to subscribe to the normal Click event and then find out myself if the thumb moved or not?
  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 16 Dec 2011 Link to this post

    Hi Peter,

     You are right as long as you don't use Ticks. Consider the following scenario:

    <telerik:RadSlider Width="400"
                              Height="30"
                              IsMoveToPointEnabled="false"
                              Maximum="10"
                              Ticks="2,4,6,8" />
    This way clicking somewhere in the slider won't always move the Thumb under your Mouse pointer.
    As for your actual question, I suggest you to use  IsMoveToPointEnabled to true and the ValueChanged event.
    Furthermore, you can drag the Thumb and slide it and you can get the ValueChanged event fire only once , at the end of the drag process. This can be accomplished by setting IsDeferredDraggingEnabled to true.
    Best wishes,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top