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

Drag and Drop between TreeView without Visual Queue on one side

3 Answers 69 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 08 Dec 2010, 10:44 PM
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.

3 Answers, 1 is accepted

Sort by
0
Tsvyatko
Telerik team
answered on 09 Dec 2010, 12:17 PM
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
0
Scott
Top achievements
Rank 1
answered on 09 Dec 2010, 07:42 PM
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!
0
Tsvyatko
Telerik team
answered on 14 Dec 2010, 03:20 PM
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
Tags
DragAndDrop
Asked by
Scott
Top achievements
Rank 1
Answers by
Tsvyatko
Telerik team
Scott
Top achievements
Rank 1
Share this question
or