Reload treeview but leave nodes that were open open

4 posts, 0 answers
  1. Jeff Bradshaw
    Jeff Bradshaw avatar
    27 posts
    Member since:
    Oct 2008

    Posted 03 Feb 2011 Link to this post

    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.
  2. Nikolay Tsenkov
    Nikolay Tsenkov avatar
    734 posts

    Posted 09 Feb 2011 Link to this post

    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).

    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.
  3. DevCraft R3 2016 release webinar banner
  4. Abbas
    Abbas avatar
    3 posts
    Member since:
    Oct 2013

    Posted 11 Oct 2013 Link to this post

    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

  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 16 Oct 2013 Link to this post

    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.

Back to Top