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

Reload treeview but leave nodes that were open open

3 Answers 64 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Jeff Bradshaw
Top achievements
Rank 1
Jeff Bradshaw asked on 03 Feb 2011, 09:23 PM
I have a treeview where the user will be able to drag and drop nodes to change the structure. When they drop the node somewhere, it will write out to the database the changes in server side code. That all works fine. But I need to reload the treeview in order to get it to show the changes. When I do that, the treeview is collapsed. I'd like to leave it in the same state it was in so the user doesn't need to go and re-expand everything.

In the NodeDrop event I have figured out how to add the node to the new location. I just can't figure out how to delete the old one.

TIA - Jeff.

3 Answers, 1 is accepted

Sort by
0
Nikolay Tsenkov
Telerik team
answered on 09 Feb 2011, 10:52 AM
Hello Jeff Bradshaw,

If you add the dropped node to the target NodeCollection, the node should be automatically transferred and you will not have to delete it from the old place. Are you copying/cloning the node?
Please, try to just add the node to the new location and let me know the results.

If the node's still being on both places, please post some code which will reproduce this at our end (you can also open a support ticket and send us a sample project).


Regards,
Nikolay Tsenkov
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Abbas
Top achievements
Rank 1
answered on 11 Oct 2013, 07:01 AM
Hallo,
What happen with me exactlly like what you just described.
When I drag one node from one treeview to other one , its automaticlly deleted from the old one.

But in my case.
I want to keep it in the old one and not delete it when I drage and drop (copying/cloning).


Waiting for your reply

Thanks
0
Shinu
Top achievements
Rank 2
answered on 16 Oct 2013, 12:00 PM
Hi A,

Please have a look into this documentation on Copy or Move Nodes from one TreeView to another using the CTRL key which deals with the same scenario.

Thanks,
Shinu.
Tags
TreeView
Asked by
Jeff Bradshaw
Top achievements
Rank 1
Answers by
Nikolay Tsenkov
Telerik team
Abbas
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or