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

How to retrieve values from date range slider?

2 Answers 171 Views
Slider
This is a migrated thread and some comments may be shown as answers.
Bethany
Top achievements
Rank 1
Bethany asked on 12 May 2015, 02:36 PM

Hello,

I am having a hard time finding a concrete definition or documentation on how to retrieve range values from RadSlider. I have tried several ideas I found going through these forums, the demos, and other sites online but to no avail have I found a solution. Is there something I am missing?

Lines 1-2 return the index of the currently selected items, but not the value itself. I found this in the RadSlider demo, but I am not sure how this would work for a date range (represented as a string).

Lines 4-5 allows me to see one of the values, but I am not sure how to get the range and not just one value.

Lines 7-8 allowed me to see the values that I wanted, but when I tried converting the values to datetime variables, Visual Studio returned an error stating that I couldn't convert decimals to datetime.

The end goal is to connect the RadSlider to the RadHtmlChart and have the dates of the chart correlate with what the user chooses in the slider; an example of this would be the Olympic Medal site on the Telerik demos.

 

Any help would be greatly appreciated!

1.Dim temp1 As String = rsDateRange.SelectionStart.ToString()
2.Dim temp2 As String = rsDateRange.SelectionEnd.ToString()
3. 
4.Dim value As Integer = rsDateRange.Value
5.Dim str As String = rsDateRange.Items(value).Value.ToString()
6. 
7.Dim tempStart As RadSliderItem = rsDateRange.Items(rsDateRange.SelectionStart)
8.Dim tempEnd As RadSliderItem = rsDateRange.Items(rsDateRange.SelectionEnd)

2 Answers, 1 is accepted

Sort by
0
Bethany
Top achievements
Rank 1
answered on 14 May 2015, 04:11 PM
1.Dim getSliderStart As Integer = rsDateRange.SelectionStart
2.Dim getSliderSValue As String = rsDateRange.Items(a).Value.ToString()
3. 
4.Dim getSliderEnd As Integer = rsDateRange.SelectionEnd
5.Dim getSliderEValue As String = rsDateRange.Items(c).Value.ToString()
0
Slav
Telerik team
answered on 15 May 2015, 01:30 PM
Hi Bethany,

As you already found out, you can get the value of a RadSlider item when you retrieve the item via its index, then access its Value property. You can find attached a sample page that demonstrates this approach.

I agree that there is not enough documentation about using a slider with items. A request for improving the help resources on the matter is already logged and the documentation will be improved with a future update.

Regards,
Slav
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Slider
Asked by
Bethany
Top achievements
Rank 1
Answers by
Bethany
Top achievements
Rank 1
Slav
Telerik team
Share this question
or