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

Problem using Drag & Drop when nesting a Slider in a TreeView control

2 Answers 25 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Richard H
Top achievements
Rank 1
Richard H asked on 30 Apr 2010, 04:34 AM
Hi there,

I want to embed a RadSlider control in my ItemTemplate that is used to display items in a RadTreeView control. However, when Drag & Drop is enabled for the RadTreeView (a feature I require), the Drag & Drop preview is displayed whenever adjust the RadSlider with the mouse. This obscures the view of the slider control. I would like to hide the Drag & Drop preview when I adjust the slider.

I have simplified the problem down to the following code which demonstrates the problem. Just click on the slider and adjust it, you will see a Drag & Drop preview:

<telerikNavigation:RadTreeView IsDragDropEnabled="True" Grid.Column="1">  
  <telerikNavigation:RadTreeViewItem Header="Test" IsExpanded="True">  
    <telerik:RadSlider Minimum="0" Maximum="100" Width="100" HorizontalAlignment="Left" /> 
  </telerikNavigation:RadTreeViewItem> 
</telerikNavigation:RadTreeView> 

I've tried implementing the MouseLeftButtonDown event on the RadTreeView control and setting e.Handled = true, but the event still seems to bubble up and cause the Drag & Drop Preview to be displayed over top of the RadSlider control.

Is there a way to prevent the Drag & Drop Preview from being displayed when I adjust the RadSlider control but still have the ability if I click elsewhere to be able to Drag the item (I need to be able to reorder items in the RadTreeView control which is why I need the Drag and Drop support)?

Thanks, Richard

2 Answers, 1 is accepted

Sort by
0
Accepted
Tina Stancheva
Telerik team
answered on 05 May 2010, 03:59 PM
Hi SWITCH,

If you set telerikDragDrop:RadDragAndDropManager.AllowDrag="True" for the RadSlider, then you add a class handler for the OnDragQuery() event and handle it in order to deny drag and drop for the RadSlider.

I attached a project illustrating the suggested approach. Please take a look at it and let me know if it works for you.

Kind regards,
Tina Stancheva
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
0
Richard H
Top achievements
Rank 1
answered on 06 May 2010, 02:19 AM
Fantastic! That did the trick. I figured it was something simple like that.

Thanks very much for the quick response!
Tags
TreeView
Asked by
Richard H
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Richard H
Top achievements
Rank 1
Share this question
or