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

Drag and Drop DragCue Change

1 Answer 73 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 13 Oct 2011, 10:58 PM
Is there a way that I can use the built in Drag and Drop handler while Dragging and Dropping in a RadTreeView, while modifying the DragCue message?  I have a couple of my own rules that I use in a PreviewDragEnded function, and I would like to change the DragCue to show what is allowed or not. 

For example, if I have a tree with
Tree
--Nest
---Bird
---Bird2

I can set the PreviewDragEnded function to check that you don't drop a Nest into a bird.  If you do, then I use e.handled = true and ignore the drag and drop action.  I would like for the DragCue to show that it is not allowed first, instead of just not allowing it after the mouse button is released.  I can do this if I write the DragQuery, DragInfo, DropQuery, and DropInfo functions, but I want to use the Rad versions of these functions that already exist (except for the modified DragCue, of course).

Thanks for your help.
Scott

1 Answer, 1 is accepted

Sort by
0
Tsvyatko
Telerik team
answered on 17 Oct 2011, 04:57 PM
Hi Scott,

 You have two options:

 - use DragOverTree event and get modify the drag cue there (you can access it from RadDragAndDropManager.Options.DragCue, or save it in a local variable on dragQuery)

 - use dropQuery (you need to subscribe with the following code:

tree.AddHandler(RadDragAndDropManager.DropQueryEvent,new EventHandler<DragDropQueryEventArgs>(OnDropQuery),true));


Let us know if you have any further questions regarding this scenario.
All the best,
Tsvyatko
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
DragAndDrop
Asked by
Scott
Top achievements
Rank 1
Answers by
Tsvyatko
Telerik team
Share this question
or