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

Saving treeview after drag and drop

1 Answer 70 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
jnh999
Top achievements
Rank 1
jnh999 asked on 08 Dec 2010, 02:31 PM

 

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.

1 Answer, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 10 Dec 2010, 11:11 AM
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
Tags
DragAndDrop
Asked by
jnh999
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or