Force use of slider handles

6 posts, 1 answers
  1. Tom
    Tom avatar
    49 posts
    Member since:
    Oct 2010

    Posted 09 Oct 2014 Link to this post

    Sorry if this is a duplicate--couldn't find this question elsewhere...

    I would like my range RadSlider to only accept changes via dragging the handles, not by clicking on the track itself. What should I set to achieve this? I noticed that setting SmallChange and LargeChange to zero caused the slider to disappear. Here is my current definition:

    <telerik:RadSlider runat="server" ID="rslSol" IsSelectionRangeEnabled="True" Width="150" ShowDecreaseHandle="False" ShowIncreaseHandle="False" ThumbsInteractionMode="Push" EnableDragRange="False" TrackMouseWheel="False" OnClientValueChanged="rlsSolSlideChanged" OnClientSlideEnd="rslSolSlideEnd"></telerik:RadSlider>

    And here's how it looks (attached image):

  2. Answer
    Slav
    Admin
    Slav avatar
    1359 posts

    Posted 14 Oct 2014 Link to this post

    Hello Tom,

    It is not possible to disable the changing of the value of RadSlider when you click on its track out-of-the-box. I have logged this feature request in our feedback portal so you can use the following item to track its status, vote for it and comment it: http://feedback.telerik.com/Project/108/Feedback/Details/140253. If this feature gains a lot of votes it will be considered for implementation.

    For the time being you can try the following customization to disable the clicking on the track:
    <script type="text/javascript">
        var $ = Telerik.Web.UI;
        $.RadSlider.prototype._originalonTrackMouseDown = $.RadSlider.prototype._onTrackMouseDown;
        $.RadSlider.prototype._onTrackMouseDown = function (evt) {
     
        }
    </script>

    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.

     
  3. Tom
    Tom avatar
    49 posts
    Member since:
    Oct 2010

    Posted 14 Oct 2014 Link to this post

    Thanks, Slav. This works perfectly. I appreciate your help.
  4. David
    David avatar
    301 posts
    Member since:
    Mar 2014

    Posted 13 Nov 2019 in reply to Slav Link to this post

    Slav, for some reason handle still moves after i click on a track even though i use your suggestion

    Any ideas?

  5. Tom
    Tom avatar
    49 posts
    Member since:
    Oct 2010

    Posted 13 Nov 2019 Link to this post

    David, FWIW I still use Slav's suggested code in my web app. It lives inside a JavaScript code block on my aspx page. I modified it only slightly by setting a variable name like so:

    1.var $twu = Telerik.Web.UI;
    2.$twu.RadSlider.prototype._originalonTrackMouseDown = $twu.RadSlider.prototype._onTrackMouseDown;
    3.$twu.RadSlider.prototype._onTrackMouseDown = function (evt) { }
  6. David
    David avatar
    301 posts
    Member since:
    Mar 2014

    Posted 13 Nov 2019 in reply to Tom Link to this post

    Hi Tom,

    Thank you for the input. You likely correct, seems i am getting javascript error (Telerik undefined), so need to figure it out first.

    Thank you

    David

Back to Top