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

DragDrop problems

1 Answer 55 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Todd
Top achievements
Rank 1
Todd asked on 29 May 2008, 07:01 PM
We are having several problems with radTreeview:

1) If the target tree is empty there seems to be no way to get the right events to fire - so we cannot add new nodes.  There are ugly work-arounds like adding a dummy node on mouseEnter but thats no good.

2) DragAndDrop between two treeviews seems to have a lot of bugs as well.

What we are trying to accomplish is this:

1) on the left a tree view with some stuff in it.  On the right an empty tree view.

2) allow the user to drag items from left treeview to right treeview.

This should be easy and it is not.

Windows Vista / VS2008 / Telerick Rad Q1 2008 WinForms

1 Answer, 1 is accepted

Sort by
0
Jordan
Telerik team
answered on 30 May 2008, 08:31 AM
Hello Todd,

Indeed a node cannot be dropped in an empty RadTreeView at the moment. We have that on our TODO list and it will be fixed.

For now, you could use the idea with a dummy node by handling the DragEnded event of the source RadTreeView as shown below:

void radTreeView1_DragEnded(object sender, RadTreeViewDragEventArgs e) 
        { 
            if (e.TargetNode.Text == "Drag nodes here"
            { 
                this.radTreeView2.Nodes.Remove(e.TargetNode); 
                this.radTreeView2.Nodes.Add(e.Node); 
                this.radTreeView1.DragEnded -= new Telerik.WinControls.UI.RadTreeView.DragEndedHandler(radTreeView1_DragEnded); 
            } 
        } 

I hope this helps. If you need any further information, please let me know.

Kind regards,
Jordan
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Treeview
Asked by
Todd
Top achievements
Rank 1
Answers by
Jordan
Telerik team
Share this question
or