Hi,
I am using version Q3 1114 2013 of your controls.
I want to use the slider for a date range, where the start and end dates vary so they have to be set at runtime.
I want to show ticks of the dates between the start and end date range, so the user will be able to see the timeline. I am currently using SmallChange="7" and LargeChange="28" so that each small change is a week and each large change is 4 weeks.
If I understand correctly, I need to set ItemType="Item" and then add RadSliderItems to create the ticks.
Of course since I don't have a fixed date range, I will have to add RadSliderItems at runtime as well.
I have the slider working correctly until I programatically add the RadSliderItems. If I add the RadSliderItems programatically, the RadSlider's SelectionStart and SelectionEnd are no longer set correctly. Instead of them being set to the leftmost and rightmost dates in the range, they are both set to the far right.
My first question is: Do you have an example of doing this? Please don't refer me to your online demo for adding RadSliderItems. It doesn't show how to do all of this programatically using dates.
Here is my code. Can you tell me what I might be doing wrong, that would cause my SelectionStart and SelectionEnd to be wrong when I add my RadSliderItems?
If I comment out the code that adds the RadSliderItems, the code below that (that sets the minimum / maximum / selectionstart / selectionend) works fine and the slider works fine.
Dim firstDate As Date = Today
Dim lastDate As Date = Today
If (Not Page.IsPostBack) Then
firstDate = filteredTaskList(0).apTaskPlannedStart
lastDate = filteredTaskList(filteredTaskList.Count - 1).apTaskPlannedEnd
Do Until firstDate >= lastDate
Dim rsi As New RadSliderItem(firstDate.ToShortDateString, firstDate.ToShortDateString)
RadSlider1.Items.Add(rsi)
firstDate = firstDate.AddDays(28)
Loop
End If
If (Not Page.IsPostBack) Then
RadSlider1.MinimumValue = CInt(filteredTaskList(0).apTaskPlannedStart.ToOADate)
RadSlider1.MaximumValue = CInt(filteredTaskList(filteredTaskList.Count - 1).apTaskPlannedEnd.ToOADate)
RadSlider1.SelectionStart = CInt(filteredTaskList(0).apTaskPlannedStart.ToOADate)
RadSlider1.SelectionEnd = CInt(filteredTaskList(filteredTaskList.Count - 1).apTaskPlannedEnd.ToOADate)
Else
filteredTaskList = From tasks In filteredTaskList _
Where tasks.apTaskPlannedStart >= Date.FromOADate(RadSlider1.SelectionStart.ToString) AndAlso tasks.apTaskPlannedEnd <= Date.FromOADate(RadSlider1.SelectionEnd.ToString) _
Select tasks
End If
Regards,
Brent
I am using version Q3 1114 2013 of your controls.
I want to use the slider for a date range, where the start and end dates vary so they have to be set at runtime.
I want to show ticks of the dates between the start and end date range, so the user will be able to see the timeline. I am currently using SmallChange="7" and LargeChange="28" so that each small change is a week and each large change is 4 weeks.
If I understand correctly, I need to set ItemType="Item" and then add RadSliderItems to create the ticks.
Of course since I don't have a fixed date range, I will have to add RadSliderItems at runtime as well.
I have the slider working correctly until I programatically add the RadSliderItems. If I add the RadSliderItems programatically, the RadSlider's SelectionStart and SelectionEnd are no longer set correctly. Instead of them being set to the leftmost and rightmost dates in the range, they are both set to the far right.
My first question is: Do you have an example of doing this? Please don't refer me to your online demo for adding RadSliderItems. It doesn't show how to do all of this programatically using dates.
Here is my code. Can you tell me what I might be doing wrong, that would cause my SelectionStart and SelectionEnd to be wrong when I add my RadSliderItems?
If I comment out the code that adds the RadSliderItems, the code below that (that sets the minimum / maximum / selectionstart / selectionend) works fine and the slider works fine.
Dim firstDate As Date = Today
Dim lastDate As Date = Today
If (Not Page.IsPostBack) Then
firstDate = filteredTaskList(0).apTaskPlannedStart
lastDate = filteredTaskList(filteredTaskList.Count - 1).apTaskPlannedEnd
Do Until firstDate >= lastDate
Dim rsi As New RadSliderItem(firstDate.ToShortDateString, firstDate.ToShortDateString)
RadSlider1.Items.Add(rsi)
firstDate = firstDate.AddDays(28)
Loop
End If
If (Not Page.IsPostBack) Then
RadSlider1.MinimumValue = CInt(filteredTaskList(0).apTaskPlannedStart.ToOADate)
RadSlider1.MaximumValue = CInt(filteredTaskList(filteredTaskList.Count - 1).apTaskPlannedEnd.ToOADate)
RadSlider1.SelectionStart = CInt(filteredTaskList(0).apTaskPlannedStart.ToOADate)
RadSlider1.SelectionEnd = CInt(filteredTaskList(filteredTaskList.Count - 1).apTaskPlannedEnd.ToOADate)
Else
filteredTaskList = From tasks In filteredTaskList _
Where tasks.apTaskPlannedStart >= Date.FromOADate(RadSlider1.SelectionStart.ToString) AndAlso tasks.apTaskPlannedEnd <= Date.FromOADate(RadSlider1.SelectionEnd.ToString) _
Select tasks
End If
Regards,
Brent