Drag and drop to a panel - Has this been added?

2 posts, 0 answers
  1. Bexm
    Bexm avatar
    67 posts
    Member since:
    May 2007

    Posted 03 Jul 2008 Link to this post

    I have read in the thread below that you were thinking of adding the ability to drag and drop from a treeview to a different control.

    I now need to be able to do this, was it ever added?



    Previous Thread

  2. Boyko Markov
    Boyko Markov avatar
    610 posts

    Posted 07 Jul 2008 Link to this post

    Hello Bexm,

    Thank you for contacting us.

    Currently we don't entirely support the OLE drag and drop feature in RadTreeView. However, I have prepared you a simple example, which demonstrates how to get the instance of tree node which is dropped on another control. Please refer to the code block below:
    1. Subscribe to the ItemDrag event
           this.radTreeView1.ItemDrag += new Telerik.WinControls.UI.RadTreeView.ItemDragHandler(radTreeView1_ItemDrag); 

         2.Get the node instance when the drag operation has started
            RadTreeNode draggedNode; 
            void radTreeView1_ItemDrag(object sender, RadTreeViewEventArgs e) 
               draggedNode =  e.Node; 
          3. Handle the mouseUp handler of RadTreeView and check if the control under the mouse is RadListBox. If the control is RadListBox we add a new ListBoxItem with text equal to the dropped node's one.
    void radTreeView1_MouseUp(object sender, MouseEventArgs e) 
               if (this.radListBox1.Bounds.Contains(e.Location)) 
                   if (draggedNode != null
                       RadListBoxItem item = new RadListBoxItem(); 
                       item.Text = draggedNode.Text; 

    I hope this helps. If you need more instructions, please feel free to contact me.

    Sincerely yours,
    Boyko Markov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top