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

Hint using Drag and Drop, LoadonDemand and Updatepanels for large Trees

3 Answers 101 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Christian
Top achievements
Rank 1
Christian asked on 03 Jul 2008, 09:10 AM
Hi,
i am starting a project with two trees on one page, with both drag and drop enabled. It should be possible to drag and drop from one tree to the other one and copy or move the subtrees. Multiselect should be enabled too and no postbacks are allowed.
The trees will have an nodecount up to 6000 nodes.
The tree will be loaded from xml out of an database. There will be an save-button to persist the changes in the tree to the xml / database.
Can someone give me an hint ho to realize this?

Is it possible to use loadondemand with serverclientcallback and draganddrop?
Should i user serverside loadondemand and put the two trees inside updatepanels?
Or should i use clientside dragDrop?
What combination of drag and drop, load on demand and updatepanels is the best for this scenario?

Thank you very much
Christian

3 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 07 Jul 2008, 08:14 AM
Hi Christian,

This is a very interesting case which involves the combination of several techniques to achieve a lightweight and visually-interrupted process.

With RadTreeView and RadAjaxManager for ASP.NET AJAX you can:
  • Use the Load-On-Demand functionality of RadTreeView to load its Nodes.
  • Perform client-side drag and drop in conjunction with the track/commitChanges() methods of RadTreeView to persist at the server any changes made at the client.
  • User RadAjaxManager to initiate an AJAX request to the server. At the server get the XML of the TreeView and update update its state to the database.
UpdatePanels will increase the amount of data transmitted between the client and server. By using the built-in Load-On-Demand functionality of the TreeView and the ability to save the client-state of the TreeView via AJAX the minimum amount of data will be transfered, therefore the page will work faster. Additionaly, using the RadAjaxManager to do AJAX requests on a client-side element's event (onclick of the 'Save' Button) will lead to less data transferred than when using UpdatePanels.

Below are listed the most important articles and examples which will help you to implement the approach:
I hope this will get you started.

Sincerely yours,
Simon
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Christian
Top achievements
Rank 1
answered on 18 Aug 2008, 10:07 AM
Hello,
thank you very much for the fast reply.
This works pretty good, but I have the problem to differ between ways, the nodes get into the treeview. How can I differ between nodes loaded on demand and nodes inserted by drag and drop on the clientside?

Thanks
Christian
0
Veselin Vasilev
Telerik team
answered on 20 Aug 2008, 02:16 PM
Hello Christian,

One of the approaches is to use CustomAttributes. You can assign a custom attribute on NodeExpand event to the nodes and later check for that attribute.

More on CustomAttributes can be found here:
http://www.telerik.com/help/aspnet-ajax/tree_attributes.html

Kind regards,
Veskoni
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
TreeView
Asked by
Christian
Top achievements
Rank 1
Answers by
Simon
Telerik team
Christian
Top achievements
Rank 1
Veselin Vasilev
Telerik team
Share this question
or