Drag and Drop DragCue Change

2 posts, 0 answers
  1. Scott
    Scott avatar
    7 posts
    Member since:
    May 2011

    Posted 13 Oct 2011 Link to this post

    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

    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.
  2. Tsvyatko
    Tsvyatko avatar
    863 posts

    Posted 17 Oct 2011 Link to this post

    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,
    the Telerik team

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

Back to Top