Saving treeview after drag and drop

2 posts, 0 answers
  1. jnh999
    jnh999 avatar
    29 posts
    Member since:
    Apr 2010

    Posted 08 Dec 2010 Link to this post

     

    Is there an event for treeview itemsource changed after a drag and drop operation?  I am interested in saving the changes to the database so I need to do the saving when nodes are added to the treeview or nodes are removed from the treeview.  It is better to do this after each drag and drop operation i.e.  incremental save.  Is there a sample anywhere to demonstrate the best way to do this?     

    I have looked around and unable to find any sample that demonstrate saving treeview after treeview collection changed.

  2. Hristo
    Admin
    Hristo avatar
    352 posts

    Posted 10 Dec 2010 Link to this post

    Hi jnh999,

    If the tree view is data bound you could track for changes in the data source collection. Meaning that you can detect changes in your data and perform the operations you want.

    However there is a DragEnded event fired by the destination tree when the drop operation is complete. So you can initiate you incremental save from handler of that event (this is the scenario when you are adding items).
    Also when you want to track the removing of items from the tree view you could use the DragStarted event (rose by the source tree) and mark the source tree view for saving. Additionally you should attach handler to the RadDragAndDropManager's DropInfo event. When the event is fired and its status is DragComplete you should perform the saving of your source tree view.

    Hope this helps. Let me know if you need more info?

    Best wishes,
    Hristo
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  3. DevCraft banner
Back to Top