473,395 Members | 1,583 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

dynamically populating treeview

Hi…I’m new to .net..so pls help me.

I have a asp.net treview. I need to populate the treview at run time from the sql database. The parent node must be bound from table tblDepartmentDetails. In this table I have deptCode,deptName. I need to populate the parent node with deptName(such as financial,customer support.IT,BuissnessDevelopememt etc…so as many depts).

Next I need to populate the child node of each parent node. The child node should be bound from table tblEmployeeDetails. In this table I have deptCode,EmployeeNumber,EmployeeName. I need to populate the childnodes with EmployeeNames. Each depts have many employes.

And atlast if click on any one of the child node(EmpName) the corresponding employe’s EmployeeNumber,EmployeeName and deptName should be displayed in textboxes(txtEmpNum,txtEmpName,txtDeptName respectivelly).

Pls help me with deatil C# code.
Sep 8 '07 #1
1 1755
Hi…I’m new to .net..so pls help me.

I have a asp.net treview. I need to populate the treview at run time from the sql database. The parent node must be bound from table tblDepartmentDetails. In this table I have deptCode,deptName. I need to populate the parent node with deptName(such as financial,customer support.IT,BuissnessDevelopememt etc…so as many depts).

Next I need to populate the child node of each parent node. The child node should be bound from table tblEmployeeDetails. In this table I have deptCode,EmployeeNumber,EmployeeName. I need to populate the childnodes with EmployeeNames. Each depts have many employes.

And atlast if click on any one of the child node(EmpName) the corresponding employe’s EmployeeNumber,EmployeeName and deptName should be displayed in textboxes(txtEmpNum,txtEmpName,txtDeptName respectivelly).

Pls help me with deatil C# code.

If it is a static database create xml file for your table like this:
<department>
<employee>
</employee>
</department>
then map it to your tree.

Other option is to parse the table to be fit in database.

1> loop foreach record
>if dept not found in tree
>create dept node
>create new treenode( empname, ..,navigation URL( ..?empNo="+no ) );
> create child node and add to above node
> add the above parent node to treeview


and on page_load use Get["empNo"] and treeview1.selectdNode.text to textbox
Sep 8 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: imassadpk | last post by:
Hi all, Apprecite your help in resolving this tricky issue... I am trying implementing Recurrsive TreeView in MS. Access 2003 ADP project. So far, no luck :( The Problem: This sample...
2
by: Janus | last post by:
Hello. I need a little advice for populating the treeview control. I dont want my application to hang while populating the treeview, there is a lot of data what's the best approach? Maybe...
0
by: N-Mayne | last post by:
Hi i was wondering if anyone knew how to Populating a TreeView control with the contents of a class and varibles etc, like netbean does but in C#. Thanks Nick Posted Via Usenet.com Premium...
8
by: Donald Xie | last post by:
Hi, I noticed an interesting effect when working with controls that are dynamically loaded. For instance, on a web form with a PlaceHolder control named ImageHolder, I dynamically add an image...
0
by: mcnewsxp | last post by:
can anyone point me towardssome good examples of dynamically populating treeview nodes. i'm using it as you would use pull down menus - for application navigation. once a user is logged in to...
0
by: Erland | last post by:
Hello all, I have just installed visual studio .net 2005 and started developing programs in asp.net 2.0. I have a scenerio where I have to populate treeview child nodes based on the entries...
5
by: marfi95 | last post by:
I have a form that has a left and right panel. In the left panel is a treeview. The right panel I want to change dynamically based on the type of node selected. What I'm doing is loading the...
0
by: hardieca | last post by:
Hi, I have created a treeview bound to a sitemap provider. I have put it into a user control (the control will be used for similar, but not always identical, functionality). The treeview...
1
by: Christian Resma Helle | last post by:
Hey guys, I'm working on an AJAX Enabled ASP.NET Web application. I have a TreeView web control and an PlaceHolder web control. My PlaceHolder is inside an UpdatePanel and AsyncPostBacks are...
2
by: Maddy | last post by:
I need to populate a treeview from a text file. The data in it is in the following form 1. (Parent Node) (a) (Child Node) (b) (Child Node) .. .. .. (k) (Child Node)
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.