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

RadTreeNodeData - Client side dataBind()???

4 Answers 265 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Sundar
Top achievements
Rank 1
Sundar asked on 17 Dec 2008, 06:49 PM
Hi,

I am trying to load a RadTreeView using client side databinding using Hierarchal data from database.
Could you please let me know whether the following is possible using RadTreeNode
1. How can i convert the Hierarchal data (I have got more that 3 child node levels) from the database, dynamically to build the RadTreeNodeData[ ] object, so that i can pass it to the RadTreeView using Webservice call or AJAX request?
2. Is there a dataBind() client side property in the RadTreeView alike RadGrid object, so that i can retreive the RadTreeNodeData[] object and bind it to the RadTreeView object? Or <WebServiceSettings Path=".." Method=".."> settings is the only way to bind the RadTreeView using Webservice call?

Actually my requirement is to load the RadTreeView control which is available inside the ItemTemplate of RadComboBox control. I want to populate the RadTreeView control on dropdown opening event.

Thanks for your support.

Thanks and regards
Sundar

4 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 20 Dec 2008, 10:19 AM
Hello Sundar,

RadTreeView can make Web Service calls only when expanding Nodes in order to load children Nodes.

Using this functionality, the hierarchical structure is progressively created as Nodes are expanded. In this way, there is no need to use hierarchical RadTreeNodeData in the Web Service responses.

I hope I have answered your questions.

Greetings,
Simon
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Sundar
Top achievements
Rank 1
answered on 20 Dec 2008, 06:41 PM
Hi Simon,

Thanks for your reply.

I understood the RadTreeView implementation of lazy loading the tree child nodes using web services.
But, what i am looking is very simple.
1. To load the tree view with the entire nodes and child nodes at the client side in one go. (I am aware that i could acheive this using server side databinding using the id and parentid in the custom object).

Lazy loading using webservices is great feature if the tree view has more data (i.e. more nodes & child nodes with many levels), but may not be a good solution if I want to display data with very few nodes and child nodes.

One solution is i guess to get the custom object collection (with id and parentId) using web service method call and loop through the object and create the tree view node and chid node dynamically in the client side (i.e. implementing the server side databinding in the client side). But i am not aware and sure whether this feature is already there.

Do you recomend any other work around or solution so that i could acheive this with less effort? I Hope, I have clearly explained my requirement.

Thanks and regards
Sundar

0
Atanas Korchev
Telerik team
answered on 21 Dec 2008, 05:28 PM
Hi Sundar,

At the time being RadTreeView supports two ways of client-side population:
  1. WebService load on demand
  2. Using the client-side API to programatically populate the control
Client-side databinding similar to RadGrid's is currently not supported - you shall need to traverse your object collection and create nodes on the fly.

All the best,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Sundar
Top achievements
Rank 1
answered on 22 Dec 2008, 03:38 PM
Thanks for your reply Albert.

The 2nd option (using the API) is the one i thought about. Do you have this feature to be implemented in the near future?
Do you have any sample code which you could share it with us?

I feel the tricky part in doing this is to create the child nodes more than 2 levels? I guess the same logic would have been used in the server side Tree view creation. Any suggestions would be of great help?

Thanks and regards
Sundar

Tags
TreeView
Asked by
Sundar
Top achievements
Rank 1
Answers by
Simon
Telerik team
Sundar
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or