473,324 Members | 2,501 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,324 software developers and data experts.

TreeView Data To Xml

Hi,

i would like to save the treeview data (nodes) into an xml file.

how should i do that ?

Thanks.
Nov 21 '05 #1
4 1291

"Tiraman :-)" <ti*****@netvision.net.il> schrieb
i would like to save the treeview data (nodes) into an xml file.

how should i do that ?


Hi Tiraman,

perhaps serializing is a solution for you:

http://groups.google.com/groups?selm...40cpmsftngxa09

Cheers

Arne Janning
Nov 21 '05 #2
If you just need something simple, try this. Note that this version doesn't
handle characters that must be escaped in XML, and it doesn't add the XML
header to the StringBuilder you're passing (you can append that before
calling the method, if you want it), but it should put you on the right
track. Pass it the TreeNode's root node (someTreeView.Nodes(0)) to save the
whole tree, or any branch node to save that branch.

Private Sub SaveAsXML(ByVal aTreeNode As TreeNode, ByVal sb As
StringBuilder)
sb.Append("<node><text>" & aTreeNode.Text & "</text>")
For Each tn As TreeNode In aTreeNode.Nodes
SaveAsXML(tn, sb)
Next
sb.Append("</node>")
End Sub

"Tiraman :-)" <ti*****@netvision.net.il> wrote in message
news:eE**************@TK2MSFTNGP10.phx.gbl...
Hi,

i would like to save the treeview data (nodes) into an xml file.

how should i do that ?

Thanks.

Nov 21 '05 #3
Thanks
I will check this article.

"Arne Janning" <sp*****************@msn.com> wrote in message
news:OC**************@TK2MSFTNGP10.phx.gbl...

"Tiraman :-)" <ti*****@netvision.net.il> schrieb
i would like to save the treeview data (nodes) into an xml file.

how should i do that ?


Hi Tiraman,

perhaps serializing is a solution for you:

http://groups.google.com/groups?selm...40cpmsftngxa09

Cheers

Arne Janning

Nov 21 '05 #4
hi,

Thanks For The Example.

"Russell Jones" <ar**@nospam.northstate.net> wrote in message
news:uR*************@TK2MSFTNGP10.phx.gbl...
If you just need something simple, try this. Note that this version doesn't handle characters that must be escaped in XML, and it doesn't add the XML
header to the StringBuilder you're passing (you can append that before
calling the method, if you want it), but it should put you on the right
track. Pass it the TreeNode's root node (someTreeView.Nodes(0)) to save the whole tree, or any branch node to save that branch.

Private Sub SaveAsXML(ByVal aTreeNode As TreeNode, ByVal sb As
StringBuilder)
sb.Append("<node><text>" & aTreeNode.Text & "</text>")
For Each tn As TreeNode In aTreeNode.Nodes
SaveAsXML(tn, sb)
Next
sb.Append("</node>")
End Sub

"Tiraman :-)" <ti*****@netvision.net.il> wrote in message
news:eE**************@TK2MSFTNGP10.phx.gbl...
Hi,

i would like to save the treeview data (nodes) into an xml file.

how should i do that ?

Thanks.


Nov 21 '05 #5

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

Similar topics

2
by: serge calderara | last post by:
dear all, Is there an easy way to bind a treeview control with an XML object as datasource? In a similar way as the dataset is doing, and build columns accroding to XML node, I could imagine a...
2
by: Trond Hoiberg | last post by:
Let say i have a bunch of files. Logfiles that is stored in subfolders. Folder1 --logfile1 --logfile2 --logfile3 Folder2 --logfile1 --logfile2 I want to display these files using data from...
7
by: vsiat | last post by:
I am trying to create a treeview out of a database table with the typical structure ID, NAME, PARENTID, TYPE, EXTRA_INFO, where is linked to the . What I want to achieve is create a tree made...
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....
3
by: Gary Dunne | last post by:
I'm writing an app that requires drag and drop operation between a ListView and a TreeView control. (The source is the ListView). During the drag drop operation I want to be able to detect the...
0
by: Henry | last post by:
I am trying to create a TreeView control that works with an ADO Dataset DataTable or the new BindingSource stuff in .NET 2.0 to build a Treeview that is populated. This is what I came up with...
8
by: Matt MacDonald | last post by:
Hi All, I have a form that displays hierarchical categories in a treeview. Ok so far so good. What I was to do is have users be able to select a node in the treeview as part of filling out the...
3
by: Jeff | last post by:
Hey ..NET 2.0 I'm trying to search a TreeView control for a specific TreeNode The code below doesn't work because it only searches the the top level of the nodes. I would like to program it...
7
by: Joe Cool | last post by:
Let's say I have a Treeview control on a form. Each leaf node in the Treeview has a ContextMenuStrip, each with one ToolStripMenuItem, and all ToolStripMenuItems Click event is handled by a comment...
3
by: dutsnekcirf | last post by:
I have a treeview control on a custom task pane in Excel. I've enable the ability to use Drag & Drop (by following this how-to) on the treeview to change the order of the nodes. The problem though...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
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...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.