How do you set the initial values of a RangeSlider?

4 posts, 1 answers
  1. Luke
    Luke avatar
    6 posts
    Member since:
    Dec 2013

    Posted 17 Dec 2013 Link to this post

    I am using MVC style API to test and develop these tools.
    I am using a range slider

        @(Html.Kendo().RangeSlider()
             .Name("yearRange")
             .Min(2000)
             .Max(DateTime.Today.Year)
             .SmallStep(1)
             .LargeStep(5)
             .Values(new double[] { 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2010, 2011, 2012, 2013 })
    )

    but I cannot see the property to set the initial value of this control.

    can someone help me please :)
  2. Answer
    Luke
    Luke avatar
    6 posts
    Member since:
    Dec 2013

    Posted 18 Dec 2013 Link to this post

    Hi Luke,

    I am no sure what you want to do. Values method will set values for the this widget but the Range Slider contains only 2 values(selectionStart and selectionEnd). Could you please give me more information about your current scenario thus I will be able to give you a quick resolution.

    Regards,
    Hristo Germanov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Luke
    Luke avatar
    6 posts
    Member since:
    Dec 2013

    Posted 18 Dec 2013 Link to this post

    I realised my mistake later on.

    I assumed the "values" property is the values of the datasource which is why I populated it with every year from 2000 to 2013.

    since the RangeSlider does not seem to allow more than 2 values, would it not be better to have an API which is SetMinValue()  and SetMaxValue()

    does the RangeSlider support more than 2 selected values?? if it does then I am wrong.
  5. Hristo Germanov
    Admin
    Hristo Germanov avatar
    703 posts

    Posted 20 Dec 2013 Link to this post

    Hello Luke,

    The RangeSlider doesn't support more then 2 values and if you need to change the slider min/max you need to recreate it.

    I hope this helps.

    Regards,
    Hristo Germanov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
Kendo UI is VS 2017 Ready