Hi Mehsud,
It is easy to create nodes and adding them dynamically in TreeView.
First of all you need to add(Drag and Drop) a TreeView(say trvDepartment)control to the aspx page to which you add childnodes.
Assume that you have an Arraylist that has Employees Names which are added as Childnodes to Department Tree(trvDepartment).
The code looks like this
TreeNode tnEmp = null;
ArrayList arrEmp = new ArrayList();
arrEmp.Add("E1");
arrEmp.Add("E2");
arrEmp.Add("E3");
foreach(string Ename in arrEmp)
{
tnEmp = new TreeNode();
tnEmp.Text = Ename;
trvDepartment.ChildNodes.Add(tnEmp);
trvDepartment.CollapseAll();
}
This way you can add Nodes to tree.
You can get the data into ArrayList from Database directly and create childnodes according to the rows returned.
Hope this helps... :)