PDA

View Full Version : TreeView : how to copy a node with Drag'nDrop ?



Pachat
9 Sep 2010, 5:02 AM
Inside a tree, or between two trees, I'd like that a dragged node get copied to the target node, without the source node being deleted.

Is this possible ?
Is there a working example from which I could built on ?

Condor
10 Sep 2010, 2:21 AM
You have to make a copy of the node in the beforenodedrop event.

ps. This has been answered before (see similar threads below).

Pachat
10 Sep 2010, 11:51 AM
You have to make a copy of the node in the beforenodedrop event.

ps. This has been answered before (see similar threads below).

Thanks, Condor. I'searched the forum, but missed the right threads. Found it now : it helped !

Pachat
13 Sep 2010, 12:41 PM
Now that, thanks to Condor, I'm able to make a copy of a node from a tree to another tree, how can I handle this :
- copying the first time a node is okay
- copying it twice, brings in the new tree two nodes with the same id

=> because of the duplication of ids, expanding / closing by clicking the first node will in fact act on the second node.

I could give a new id to the copied node : but in that case, how can I tell the children that there parent changed its name ?

The purpose is to be able to copy a node from the first tree as many times i want into the second tree.