User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C# section within the Software Development category of DaniWeb, a massive community of 391,782 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,579 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C# advertiser:
Views: 434 | Replies: 3
Reply
Join Date: May 2008
Posts: 3
Reputation: yaninea is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
yaninea yaninea is offline Offline
Newbie Poster

Build a treeview from db

  #1  
May 8th, 2008
Hi everyone, I was wondering how to build a treeview from a table in my db witch has the followings fields: RowId, NodeName, ParentNodeId.
I will appreciate any help please.
Last edited by yaninea : May 8th, 2008 at 4:23 pm.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2007
Location: Bristol, UK
Posts: 1,123
Reputation: majestic0110 is on a distinguished road 
Rep Power: 3
Solved Threads: 47
majestic0110's Avatar
majestic0110 majestic0110 is offline Offline
Veteran Poster

Re: Build a treeview from db

  #2  
May 8th, 2008
Hi there Yaninea, and welcome to DaniWeb. I believe a valuable member has already provided a great solution to this problem a month back. Check this out :

http://www.daniweb.com/forums/thread118395.html
Hope this helps you out.
If you have a quality, be proud of it and let it define you. Add it to the world!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
Reply With Quote  
Join Date: May 2008
Posts: 3
Reputation: yaninea is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
yaninea yaninea is offline Offline
Newbie Poster

Re: Build a treeview from db

  #3  
May 8th, 2008
Hi, I have a similar situation as posted in the tread you suggested only I don“t want to do it trough a class, how can I make it so the treeview will load up directly from the db?
The fields on my db are: ID, ParentId, NodeText.
Thanks very much, I will really appreciate any help
Reply With Quote  
Join Date: Nov 2006
Location: Bonners Ferry, ID
Posts: 279
Reputation: JerryShaw is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 38
JerryShaw JerryShaw is offline Offline
Posting Whiz in Training

Re: Build a treeview from db

  #4  
May 9th, 2008
You can always purchase the InfoPower controls for dot-net. They have a sub-classed TreeView that connects directly to a dataset with multiple relationships to display the tree.

Or roll your own. Bottom line is that the treeview is not a true data-aware component out of the box. Check out this link: http://www.codeproject.com/KB/tree/dbTree.aspx for work originating with Duncan Mackenzie. It is a sub-classed TreeView component that might meet you needs.

In any case, you are going to have to write code (most likely a new class or component) to populate the tree. Keep in mind that typically 99% of the time, you are going to want to get to that table record to do additional work. IOW it is not just enough to display data... you need to be able to get to the underlying record.

// Jerry
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb C# Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the C# Forum

All times are GMT -4. The time now is 5:02 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC