We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Programmatically move nodes from One tree to another

Hi,
there is a method to move an entire subtree from one tree to another, like doing a drag and drop operation,, but done programmatically?

    Thanks in advance

    Andea Perazzolo

3 Replies

SS Saranya Sivakumar Syncfusion Team March 17, 2015 09:37 AM UTC

Hi Andrea,

Sorry for the inconvenience caused.

We would like to let you know that, currently we don’t have a public method to move an entire sub tree from one tree to another tree without drag and drop. But we can achieve it programmatically and we have prepared a custom sample based on your requirement. We have attached the custom sample in the following location.

http://www.syncfusion.com/uploads/user/forum/118491/Treeview-730729990.zip

In this sample we have written the code in a button click event. In the button click, we have cut and paste the selected node by triggering “keydown” event and make control key as true. Then we have used the key code “88” to cut and “86” to paste the node. Then assign the value for “_cutCopyNodeText”. Finally trigger the event.

Please let us know if you have further queries.

Regards,

Saranya.S



AP Andrea Perazzolo March 17, 2015 05:56 PM UTC

Thanks for the sample.
I used it on my project and it works.
Just one question:
after moving the nodes, they cannot be moved with drag & drop operation.
There is a way to maintain this behaviour after the Cut & Paste operation?

   Thanks in advance

    Andrea Perazzolo


SS Saranya Sivakumar Syncfusion Team March 18, 2015 01:05 PM UTC

Hi Andrea,

We were able to reproduce the problem and we considered this issue “Drag and drop doesn’t work for the pasted node in Treeview” as bug, also have logged a report regarding this. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents

Please let me know if you have any questions.

Regards,

Saranya.S


Loader.
Live Chat Icon For mobile
Up arrow icon