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

3 posts, 1 answers
  1. Richard H
    Richard H avatar
    18 posts
    Member since:
    May 2006

    Posted 29 Apr 2010 Link to this post

    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" /> 

    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. Answer
    Tina Stancheva
    Tina Stancheva avatar
    3299 posts

    Posted 05 May 2010 Link to this post

    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.
  3. Richard H
    Richard H avatar
    18 posts
    Member since:
    May 2006

    Posted 05 May 2010 Link to this post

    Fantastic! That did the trick. I figured it was something simple like that.

    Thanks very much for the quick response!
Back to Top