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

RadSlider rangemove disable with mousedrag

7 Answers 239 Views
Slider
This is a migrated thread and some comments may be shown as answers.
Deepa
Top achievements
Rank 1
Deepa asked on 07 Mar 2011, 05:33 PM
Hi

I am setting

StepAction="MoveRange" and range is moving with the mouse click.

 

 

 

But the issue is that when I a dragging mouse then range is changing. How do I disable the Mouse drag.




HorizontalAlignment
="Right"

 

 

 

 

IsSnapToTickEnabled="True"

 

 

 

 

Margin="0,10,12,52"

 

 

 

 

Minimum="1"

 

 

 

 

Name="monthSlider"

 

 

 

 

Maximum="12"

 

 

 

 

SmallChange="0"

 

 

 

 

StepAction="MoveRange"

 

 

 

TickFrequency="1"

 

 

 

LargeChange="3"

 

 

 

 

SelectionEnd="3"

 

 

 

SelectionStart="1"

 

 

 

IsSelectionRangeEnabled="True"

 

 

 

 

SelectionRangeChanged="monthSlider_SelectionRangeChanged"

 

7 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 10 Mar 2011, 01:08 PM
Hello Deepa,

Usually, you can use the DragStarted event of the RadSlider and set e.handled = true. But it appears to be a bug in the DragStarted event, you will be soon able to track its progress in PITS (Slider: In DragStartedEventHandler the RoutedEvent of the RoutedEventArgs is not set). However , there is a workaround that uses the PreviewMouseLeftButtonDown event. You can examine it in the attached solution.

Best wishes,
Petar Mladenov
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Deepa
Top achievements
Rank 1
answered on 17 Mar 2011, 04:47 PM
Hi
Thanks for ur help.

Range move disable is working.

But i have a different issue now.

In one of the slider I am displaying 12 months with tick. I dont select any range.

But I want to disable tick and drag based on certail condition.

Say for example If I have data only for Jan to April then i will display all 12 months in the slider but I want to disable tick for rest of the months so user should be able to click or drag on Jan to Apr but not rest of the  months

Please help.

Thanks
Deepa
0
Petar Mladenov
Telerik team
answered on 19 Mar 2011, 04:54 PM
Hello Deepa,

Please examine the attached solution where a basic approach is realized. It uses TemplateSelector and IntToMonthConverter. In order to prevent the selection of month after April, the ValueChangedEvent is used which is not very elegant but it works. We are now working on major refactoring of the RadSlider and PreviewValueChanged is in our to-do list. Feel free to ask if you need further assistance.

All the best,
Petar Mladenov
the Telerik team
0
Deepa
Top achievements
Rank 1
answered on 22 Mar 2011, 03:04 AM
Hi
Thanks for your help. I am able to disable click and drag in the value change event of the month slider.

I have another range slider where I am firing rangechange.

How do I disable move based on some condition

Thanks in advance for your help.

Regards
Deepa.

0
Petar Mladenov
Telerik team
answered on 24 Mar 2011, 06:22 PM
Hi Deepa,

You can then use analogically the SelectionStartChanged, SelectionEndChanged and SelectionRangeChanged events.

Regards,
Petar Mladenov
the Telerik team
0
Deepa
Top achievements
Rank 1
answered on 24 Mar 2011, 11:56 PM
Hi

Thanks for you help. Disabling is working for me now.

I need one more help. i have two slider one is month slider and the other one is quarterslider.

Quarterslider is the rangeslider mean I move range of month so (Jan - Mar) is the first quarter and April - June second quarter etc.

When I am sliding through the month in the month slider then I need to manipulate which quarter I am based on the selected month accordingly quarter slider range should change.

I was setting quarterSlider.SelectionStart and quarterSlider.SelectionEnd outslider the slider control that means in the monthslider value cange event. But this is not working it is going on infinite loop. SelectionrangeChane of quarterslider  fires each time.

Thanks for your help in advance.

Regards
Deepa
0
Petar Mladenov
Telerik team
answered on 30 Mar 2011, 12:54 PM
Hello Deepa,

We were experiencing some issues with the TickTemplateSelector in the previous Q but we have resolved them. You could send us a runnable sample showing the issue and we will investigate your  problem. You could also see a possible approach in the attached solution. It's not working perfectly but should be a good starting point. You should also know that we a recurrently working on major refactoring of this control and its new version should be announced with the SP1 (mid April).

Best wishes,
Petar Mladenov
the Telerik team
Tags
Slider
Asked by
Deepa
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Deepa
Top achievements
Rank 1
Share this question
or