473,326 Members | 1,972 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,326 software developers and data experts.

Treeview troubles

I am running VB.Net 2005.

Currently I am experiencing problems saving and loading a Treeview to file.

I am using Text, Key and ImageIndex in the treeview nodes.

When I save the treeview to file and reload it, I loose the key value
and can only retrieve Text and Imageindex.

Does anyone here have an example that can save and load all values of
the treenode ?

The documentation I have found is a bit confusing as it refers to this
Key field also as TAG and in other cases NAME ?

Thanks in advance

Regards

David
Feb 2 '07 #1
1 1105
David wrote:
I am running VB.Net 2005.
Currently I am experiencing problems saving and loading a Treeview to file.

I am using Text, Key and ImageIndex in the treeview nodes.
I'm still using '2003, but has the '2005 TreeView /regained/ its Keys?
They disappeared in the jump from VB "Proper" to VB.Net.
When I save the treeview to file and reload it, I loose the key value
and can only retrieve Text and Imageindex.
Does anyone here have an example that can save and load all values of
the treenode ?
Depends how you want them saved - :-) - but your code needs to be
recursive, /something/ like:

Function SaveTree( ByVal oFirst As TreeNode )
Do While oFirst IsNot Nothing

SaveNode( oFirst )

If oFirst.Nodes.Count 0 Then
SaveTree( oFirst.Nodes(0) )
End if

oFirst = oFirst.Next'Node?
Loop
End Function

HTH,
Phill W.
Feb 5 '07 #2

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

Similar topics

42
by: lauren quantrell | last post by:
So many postings on not to use the treeview control, but nothing recently. Is it safe to swim there yet with Access 2000-Access 2003?
6
by: L.M | last post by:
Hello, I knew how to use the treeview under VB6. After migrating to .NET, well, I'm lost. I try to add a new node, either to the same level or as a child to a selected node in the treeview....
6
by: Sam | last post by:
Hi, I've got a treeview on the left of my form, filled with data from a database, and the user can enter new data on the right side of the form. When the user saves the data, I'd like the tree to...
1
by: EOS | last post by:
Hi, I am new to PDA development and my background is purely C/C++. Now I can get the rought ideas on Compact C# .net for PDA development. But I am having troubles on adding TreeView with nodes...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.