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

Loading the rad treeview at runtime

1 Answer 90 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Deepak
Top achievements
Rank 1
Deepak asked on 25 Jun 2008, 12:48 PM
Hi all,
I am really new to programming world.
I have a RADtreeview and i want to load the tree view at runtime from code behind. I have 2 tables in the sql server database. one is customer and other one is customer site. On the page load of the page i want to have all the customers in the customer table as the parent node of the tree and when you click on each customer i want the sites allocated to that particular customer to be loaded from the site table as the child node for that customer. I am not able to do this . Pleae help me out anyone to do this.
As it is two different tables i dont know how to load them at run time according this scenerio. I am using sql server 2005 as the database where these table resides.
Your kind response would be highly appreciated.
Regards,
Deepak

1 Answer, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 25 Jun 2008, 01:21 PM
Hi Deepak,

Welcome to Telerik Community!

Here is one of the possible approaches:

1. Load the root nodes from the first db table and set their ExpandMode property to ServerSideCallBack
2. Subscribe to the NodeExpand event of the treeview and in its event handler load the child nodes from the second db table and add them to the expanded node.

You can check this article as well: Client-Side Load On Demand

I hope that this will get you started.

Best wishes,
Veskoni
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
TreeView
Asked by
Deepak
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Share this question
or