Drag and Drop between TreeView without Visual Queue on one side

4 posts, 0 answers
  1. Scott
    Scott avatar
    42 posts
    Member since:
    Oct 2007

    Posted 08 Dec 2010 Link to this post

    I have a two TreeView controls, one on the left side and one on the right side. The users should be able to drag items from the left side to the right side, but not the other way around. I have this functionality working, but I want to remove the visual elements (Drag Preview, Preview Line and Tooltip) when the drag is over the left side so that the users don't think that they are allowed to drag. 

    I've tried setting the following:
    IsDragPreviewEnabled="False"
    IsDragTooltipEnabled="False"
    IsDropPreviewLineEnabled="False"
    But I still get all the visuals. I'd be fine with the visual queue that shows the red indicator saying no to the user.
  2. Tsvyatko
    Admin
    Tsvyatko avatar
    833 posts

    Posted 09 Dec 2010 Link to this post

    Hello Scott,

    In order to hide and show drag cue I can suggest to attach to RadDragAndDropManager DragInfo and DropInfo events of the treeviews and change Visibility of the e.Options.DragCue.

    Let me know if this works in your case.

    Greetings,
    Tsvyatko
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for WPF
  3. UI for WPF is Visual Studio 2017 Ready
  4. Scott
    Scott avatar
    42 posts
    Member since:
    Oct 2007

    Posted 09 Dec 2010 Link to this post

    Tsvyatko,
    Thank you for your response. I implemented your suggestion and this is partially what I wanted, but it may be very difficult to achieve exactly what I am looking for going this route because I am still going to have to implement the visual styles on the right side treeview manually I assume.

    What would be ideal is if I still had the default visual styles on the left, but the user just wasn't allowed to drop on the left. Basically, I want to set the IsDragDropEnabled on the left side, but whenever the mouse is on the left side, I want them to get the visual indicator showing them that they can't drop. Also, I want to exclude the Drop Before, Drop After and the Preview Line.

    I was hoping that setting AllowDrop="False" would do all of this for me, but unfortunately it does not. If drag and drop is disabled, the user should not have the impression that they can drop, right? 

    In my situation, the left side is the source and the right side is the destination.

    Again, thanks for your support!
  5. Tsvyatko
    Admin
    Tsvyatko avatar
    833 posts

    Posted 14 Dec 2010 Link to this post

    Hello Scott,

    I have prepared sample application demonstrating alternative approach. Please, have a look and let me know if this is the desired behavior or if you have any further questions.

    Greetings,
    Tsvyatko
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for WPF
Back to Top