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

RadSlider thumb dragging issue

2 Answers 75 Views
Slider
This is a migrated thread and some comments may be shown as answers.
Abdelkarim
Top achievements
Rank 1
Abdelkarim asked on 28 May 2014, 07:14 AM
Hi

we have a RadSlider with IsSelectionRangeEnabled=True, our requirement is that both Thumbs should push one another while dragging.

I would like that you confirm to me whether this is possible with the current RadSlider control. It seems that setting IsCoercionSuppressed to true or false does not yield our desired effect.

Regards
Abdelkarim

2 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 31 May 2014, 07:06 AM
Hi Abdelkarim,

The described functionality is not supported out of the box. However, you can implement it with custom logic. Basically you can get the Thumb elements (with the ChildrenOfType<T>() method) in the Loaded event handler of the RadSlider.Then add handlers for the DragDelta events of the thumbs and change update the thumbs position inside them.

For your convenience I attached a sample project that demonstrates this approach. Note that this implementation is not well tested and I cannot guarantee that it will work in all possible cases. This is why I recommend you to take some time to test it and see if it's going to work for you.

Regards,
Martin
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Abdelkarim
Top achievements
Rank 1
answered on 31 May 2014, 05:03 PM
Hi Martin,

Thanks for your response, your solution was not what I am looking for, I wanted the thumbs to push each other only when they're adjacent, not when they're far from each other.

but your sample gave me a hint to the solution, so Thank you.

I achieved the solution by inheriting the RadSlider and subscribing for the events in the OnApplyTemplate method override, I then push a thumb only when there is a change and the distance between the two thumbs is zero.

Regards
Abdelkarim
Tags
Slider
Asked by
Abdelkarim
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Abdelkarim
Top achievements
Rank 1
Share this question
or