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

Drag'n drop from datalist to treeview

3 Answers 16 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
jc mag
Top achievements
Rank 1
jc mag asked on 26 Jan 2011, 03:17 PM
I have a page with a DataList and a RadTreeView and now I should allow drag'n drop from datalist's items to the treeview. I wonder what is the best approach to do this:
1/ using custom javascript
2/ replacing the DataList with a RadListView, to do the same as this: http://demos.telerik.com/aspnet-ajax/listview/examples/itemdragdrop/defaultcs.aspx

What is the easiest and fastest method?

3 Answers, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 31 Jan 2011, 12:15 PM
Hello Jc,

It's better to use RadListView along with the RadTreeView , since both of the controls support drag'n'drop functionality. In order to use this functionality of the ListView , first you should enable it using the following AllowItemsDragDrop="true" property . Also you should add RadListViewItemDragHandle control to your ListView. In order to enable the drag-and-drop functionality of the RadTreeView you should set EnableDragAndDrop="true" property. When the RadTreeView detect a valid drag-and-drop operation it fires a server-side event NodeDrop , where you should perform the desired action.
You have already pointed the demo for the ListView , but there is also e another demo for TreeView drag-and-drop here. Also you could check these two help articles here and here.



All the best,
Dimitar Terziev
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
Sean
Top achievements
Rank 1
answered on 12 Jul 2013, 02:11 PM
How might I do the inverse? I want drag from the treeview to the listview
0
Dimitar Terziev
Telerik team
answered on 17 Jul 2013, 07:51 AM
Hi Sean,

You should be able to drag from the RadTreeView and drop in the RadListView, using a similar logic as the one suggested in my previous post. Both control relies on events for their drag-n-drop operations, so you should handle these event and use your custom logic in order to achieve the desired functionality.

Regards,
Dimitar Terziev
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
TreeView
Asked by
jc mag
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
Sean
Top achievements
Rank 1
Share this question
or