Whether this data is read in as XML or not, the tree would still (IMO)
have to be built up using traditional programming methods (message calls
to the TreeView object) -so Im not too sure where Iain is coming from
(although there would be occasions that reading data from the database as
XML would be benefical).
He might be suggesting in this instance that if you have a hierachical
view of the data to recurse through then it would simplify the technique
for mirroring this in a TreeView and this is probably correct.
Anyhow whatever technique you use for reading in the data the following
are the TreeView methods you will use to build up the data tree:-
treeViewName.Nodes.Add(node) //to add a directory if tree is
empty -will only happen once
node.Nodes.Add(node) //to add a directory if parent has been found in
tree and navigated to
node.Parent //to assign a reference to a parent node of a node (for use
in navigating up the tree) -note that the reference may be null if a
parent doesnot exist
node.Nodes[x] //to assign a reference to a child node within the node's
node collection -to find is node for directory has already been added
node.Nodes.Count //for use with above
etc.etc.
It really is quite simple and you will probably be able to write some very
efficient code.
--
Best Regards,
Mark
Mark Broadbent
mcad,mcdba,mcse+i
emailto: newsgroupsATmettayyaDOTgotadslDOTcoDOTuk
remove AT with '@' and DOT with '.' -please do not send spam or address
will be changed!
Alex said:
Hello!
Thanks so much! but do u have another method like traditional
programming? I
know nothing about XML ...
)