473,606 Members | 3,113 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to load hierarchical Db data in treeview??

Don

In a previous version of vb I used to save and load hierarchical data
from an Access db into a treeview. But, I never found a very
satisfying or elegant way to do it. I used a flat file approach with
each item having a reference to its parent node. I would then start
by loading the top level nodes folowed by loading child node data only
as their parent node was expanded.

This method worked fairly well except that allowing the user to drag a
node from one parent to another meant having to update the record's
parent and hope you could catch any boogers that may occur.

Loading child nodes as needed works just fine but is there a better
way to do all this hocus pocus with vb.net 2003? I've started to learn
vb.net about 13 times over the last few years but have not put much
time into it.

Thank you for any non profane help, <g>

Don

(Just kidding about the @#$% profanity)
Feb 17 '06 #1
2 5860
Hi, do a search on this group with google on "treeview recursive loop"
this should get you started

Hope this helps
Greetz Peter

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)

"Don" <don81846@NO_Ca Ca.Earthlink.ne t> schreef in bericht
news:q8******** *************** *********@4ax.c om...

In a previous version of vb I used to save and load hierarchical data
from an Access db into a treeview. But, I never found a very
satisfying or elegant way to do it. I used a flat file approach with
each item having a reference to its parent node. I would then start
by loading the top level nodes folowed by loading child node data only
as their parent node was expanded.

This method worked fairly well except that allowing the user to drag a
node from one parent to another meant having to update the record's
parent and hope you could catch any boogers that may occur.

Loading child nodes as needed works just fine but is there a better
way to do all this hocus pocus with vb.net 2003? I've started to learn
vb.net about 13 times over the last few years but have not put much
time into it.

Thank you for any non profane help, <g>

Don

(Just kidding about the @#$% profanity)

Feb 17 '06 #2
If you are open to commercial solutions take a look at Infralution's
Virtual Tree control. It has a really elegant databinding mechanism
that allows you to bind easily to hierarchical data from a Database.

You can get more information and download a fully functional evaluation
version from:

www.infralution.com/virtualtree.html

Regards
Grant Frisken
Infralution

Don wrote:
In a previous version of vb I used to save and load hierarchical data
from an Access db into a treeview. But, I never found a very
satisfying or elegant way to do it. I used a flat file approach with
each item having a reference to its parent node. I would then start
by loading the top level nodes folowed by loading child node data only
as their parent node was expanded.

This method worked fairly well except that allowing the user to drag a
node from one parent to another meant having to update the record's
parent and hope you could catch any boogers that may occur.

Loading child nodes as needed works just fine but is there a better
way to do all this hocus pocus with vb.net 2003? I've started to learn
vb.net about 13 times over the last few years but have not put much
time into it.

Thank you for any non profane help, <g>

Don

(Just kidding about the @#$% profanity)


Feb 18 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1796
by: jayson_13 | last post by:
Hi, I want to retrieve the hierarchical structure which is store inside the database and then display it using treeview control. But now I got a design issue which I hope that you guys can help me. My hierarchical structure has five levels which is store in table call level1, level2,… level5. Each level remember the parent ID e.g. level5 contains a column called level4ID. How should I implement it in order to get fastest loading?...
1
1862
by: Neil McGuigan | last post by:
Hi, I want to store product categories in my db and am a little lost as to where to start. They can be hierarchical, such as "Books" > "Cook Books", so my table is like this: int CategoryId int ParentCategoryId Nullable
3
2029
by: Bennett Haselton | last post by:
I want to display a hierarchical listing of items from a database table, where, say, each row in the table has an "ID" field and a "parent_id" field giving the ID of its parent (NULL if it's at the top level of the hierarchy) -- like message posts and their replies. Is there a built-in way to do this, or a generally accepted simplest way? My first idea was to create a user control like HierarchicalListing that contains a Repeater, and...
14
15075
by: Mr.D | last post by:
How do I save/load the contents of a Treeview to a file? I have found several good examples written i VB6, but not a single one for VB.NET. Please help. ---- Tim
5
2656
by: Kent Boogaart | last post by:
Hi, I have some hierarchical data (FAQs) that I would like to bind to. The basic structure is: FAQ Category + Categories + FAQs So an FAQ category has any number of sub-categories and any number of FAQs.
2
2937
by: Franky | last post by:
Threre is a Form containing a usercontrol In the form's Load event it references a usercontrol property, say, zz The first showdialog(formx) causes 1 usercontrol_load event 2 form_load event which causes zz as expected the second showdialog(formx) causes 1 form_load event which causes zz as expected
2
1530
by: Olav | last post by:
I need a control to display a hierarchical tree of data and each node in the tree should have a checbox to select / unselect that part of the tree. Selecting / unselecting a top node should select / unselect all the children. What kind of control is best fit for this? Any samples? Olav
0
1282
by: Adam Right | last post by:
Hi ! I have a hierarchical field (from database with a DataReader) , every 3 digit must stand for a node in a TreeView item for windows application Sample collocation is ... ------------------------------------------- 000 --root 000000 --roots first node 000000000 --child of roots first node 000001 --roots second node
4
4372
by: Marco Pais | last post by:
Hi there. I am trying to find th best way (best UI control) to present hierarchical data, nested tables. For example, I have a Employees table (id, name) and EmployeesSales (id, idEmp, description, value). I want to show this in an hierarchical mode, so I tried DataGrid control. However, as I read somewhere, this DataGrid can only show one table at a time, i.e., when I click "plus" sign, I have only a link to the EmployeesSales table.
0
7978
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8461
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8448
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8126
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8317
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5987
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5470
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4010
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2454
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.