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

Setting isSelectionRangeEnabled on Client-Side

4 Answers 31 Views
Slider
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 2
Jason asked on 17 Oct 2013, 08:42 PM
I have an issue setting isSelectionRangeEnabled on the client-side 

I have a dropdownlist and a slider,  When the ddl has a value of 3 I want to make sure selection range is turned on.

function operatorChanged() {
    var slider = $find('<%= slideNewRating.ClientID %>');
    var ddlOperators = document.getElementById("<%=ddlOperators.ClientID%>");
    var value = ddlOperators.options[ddlOperators.selectedIndex].value;
    if (value == 3) {
        slider.set_isSelectionRangeEnabled(true);
        slider.set_selectionStart = 1;
        slider.set_selectionEnd = 3;
    }
    else
        slider.set_isSelectionRangeEnabled(false);
                 
}

This works fine on my page.  The slider instantly changes from a single value selection to a range.

My problem is after postback and trying to obtain the slider range values to use in C# to send them to the database.
I can move the 2 sliders all over track but on posting and setting breakpoint in my code i find; The isSelectionRangeEnabled value shows as true, but SelectionEnd and SelectionStart values are always 0 and the Value property is equal to what the SelectionStart value should be.

Even when I explicitly set the selection range like in my code above this occurs.  Its like the control gets half set into different selection modes from the client-side.

Thoughts?

4 Answers, 1 is accepted

Sort by
0
Accepted
Slav
Telerik team
answered on 18 Oct 2013, 01:40 PM
Hello Jason,

Please note that set_selectionEnd and set_selectionStart are functions and the new values should be passed as parameters. Also, it is recommended to set the selection end value first, otherwise the end selection will be updated twice and the starting value will not be applied. The following code sample demonstrates this:
slider.set_selectionEnd(70);
slider.set_selectionStart(30);

Regards,
Slav
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Jason
Top achievements
Rank 2
answered on 18 Oct 2013, 01:55 PM
ah, bad javascript code.  So it does like you do have to set some sort of value first.  IM trying this out now, but one more question...

Is there a client-side equivalent of server side .SelectedRegionStartValue?  I dont see it here http://www.telerik.com/help/aspnet-ajax/slider-client-object.html
0
Slav
Telerik team
answered on 18 Oct 2013, 02:40 PM
Hello Jason,

This property is not exposed in the client-side object of the RadSlider and currently it can be configured only on the server-side. You can post a feature request for creating a function that will set it on the client in our Feedback portal.

It is an option to use an AJAX request for dynamically changing this setting, if it is required in your project.

Regards,
Slav
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Jason
Top achievements
Rank 2
answered on 18 Oct 2013, 02:44 PM
I was already on my way doing exactly that just in case it wasn't available, sometimes things are missing from the documentation and I stumble across them in Google search results.  Thank you again for your help Slav!
Tags
Slider
Asked by
Jason
Top achievements
Rank 2
Answers by
Slav
Telerik team
Jason
Top achievements
Rank 2
Share this question
or