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

Increase/Decrease arrows do LargeChange

1 Answer 59 Views
Slider
This is a migrated thread and some comments may be shown as answers.
Clarence Klopfstein
Top achievements
Rank 1
Clarence Klopfstein asked on 22 Oct 2009, 06:25 PM
Is it possible to have the increase/decrease arrows move the selection by the large change value instead of the small change value?

If not, may I recommend such a feature... would help me a ton right now :-)

1 Answer, 1 is accepted

Sort by
0
Tsvetie
Telerik team
answered on 26 Oct 2009, 07:40 AM
Hi Clarence Klopfstein,
The RadSlider does not offer such functionality, however, you can achieve this using the client-side API of the control:
<telerik:RadSlider ID="RadSlider1" runat="server" ItemType="Tick" Width="400px" Height="70px"
TrackPosition="BottomRight" SmallChange="5" LargeChange="10" OnClientBeforeValueChange="OnClientValueChanging"
OnClientSlideStart="OnClientSlideStart" OnClientSlideEnd="OnClientSlideEnd">
</telerik:RadSlider>
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
 
<script type="text/javascript">
    var avoidRecursion = false;
    function OnClientValueChanging(sender,args)
    {
        // Change the behavior of the slider only in case the user is not manually dragging the dragHandle.
        if(isSliding || avoidRecursion) return;
         
        args.set_cancel(true);
        var largeChange = sender.get_largeChange();
        var newValue = args.get_newValue();
        var oldValue = sender.get_value();
        if(newValue == oldValue) return;
         
        var valueChange = ((sender.get_value() < newValue) ? 1 : (-1)) * largeChange;
         
        avoidRecursion = true;
        sender.set_value(oldValue + valueChange);
        avoidRecursion = false;
    }
 
    var isSliding = false;
    function OnClientSlideStart(sender,args)
    {
        isSliding = true;
    }
 
    function OnClientSlideEnd(sender,args)
    {
        isSliding = false;
    }
</script>

Please note that when using the set_value client method of the RadSlider, the change in the value of the slider is not animated.

All the best,
Tsvetie
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Slider
Asked by
Clarence Klopfstein
Top achievements
Rank 1
Answers by
Tsvetie
Telerik team
Share this question
or