RadDragAndDropManager to DragDropManager question

2 posts, 0 answers
  1. Chris
    Chris avatar
    30 posts
    Member since:
    Oct 2010

    Posted 21 May 2013 Link to this post

    I am trying to convert a bit of code from the old RadDragAndDropManager to the new DragDropManager but the documentation is really lacking and I'm having a lot of trouble figuring out what to do.

    I just have a simple function that determines whether or not the user can drop a node in a RadTreeView.  I feel like this should be simple to replicate with DragDropManager, but I'm just missing something:

    Tree.AddHandler(RadDragAndDropManager.DragQueryEvent, new EventHandler<DragDropQueryEventArgs>(Tree_DragQuery), true);
    private void Tree_DragQuery(object sender, DragDropQueryEventArgs e)
        var targetTvi = e.Options.Destination as RadTreeViewItem;
        var sourceTvi = e.Options.Source as RadTreeViewItem;
        if (targetTvi == null || sourceTvi == null)
        if (sourceTvi.DataContext is LayerTviVM && targetTvi.DataContext is LayerTviVM)
            e.QueryResult = true;
        else if (sourceTvi.DataContext is ImageTviVM && targetTvi.DataContext is ImageTviVM)
            // We only support drag & drop of images within the same layer
            e.QueryResult = (sourceTvi.ParentItem == targetTvi.ParentItem);
            e.QueryResult = false;
  2. Yoan
    Yoan avatar
    1051 posts

    Posted 24 May 2013 Link to this post

    Hi Chris,

    Generally, this can be achieved by modifying the DragDropEffects of the current drag operation by using the DragOver event. 

    You can achieve the functionality in your question by setting the effects of the current drag operation to None.

    The usage of the drag effects can be seen here


    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft R3 2016 release webinar banner
Back to Top