Re: TreeView with Recursive TreeNode....
From: Mark Broadbent (nospam_at_nospam.com)
Date: 11/14/04
- Next message: Norm: "XP Look in HTML forms in AxSHDocVw.AxWebBrowser"
- Previous message: dotnetdivis: "ErrorProvider"
- In reply to: Mark Broadbent: "Re: TreeView with Recursive TreeNode...."
- Next in thread: Iain Mcleod: "Re: TreeView with Recursive TreeNode...."
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 14 Nov 2004 19:55:41 -0000
please read the word "directory" as "node" in my previous post. I copied and
pasted from one of my previous posts and forgot to amend the text.
-- 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! "Mark Broadbent" <nospam@nospam.com> wrote in message news:OV$9kSnyEHA.3024@TK2MSFTNGP14.phx.gbl... > 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" <chipheo2k@mail.ru> wrote in message > news:uztVm%23gyEHA.3120@TK2MSFTNGP12.phx.gbl... >> Hello! >> Thanks so much! but do u have another method like traditional >> programming? I >> know nothing about XML ...:)) >> >> >> >> >> "Iain Mcleod" <mcleodia@dcs.gla.ac.uk> сообщил/сообщила в новостях >> следующее: news:uXkGHceyEHA.2568@TK2MSFTNGP11.phx.gbl... >>> Get it as xml. >>> Got SQL Server 2000? Use SQLXML. >>> >> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/ht >> ml/anch_SQLXML.asp >>> >>> >>> Iain >>> >>> >>> "Alex" <chipheo2k@mail.ru> wrote in message >>> news:O1zmv5cyEHA.3976@TK2MSFTNGP09.phx.gbl... >>> > Hello! >>> > I must build a TreeView with recusive treenodes, my database as below: >>> > >>> > id name parentID >>> > 1 name1 0 >>> > 2 name2 0 >>> > 3 name3 0 >>> > 4 name4 1 >>> > 5 name5 1 >>> > 6 name6 4 >>> > 7 name7 6 >>> > >>> > >>> > so my treeview looks like this: >>> > >>> > something >>> > name1 >>> > name4 >>> > name6 >>> > name7 >>> > name5 >>> > name2 >>> > name3 >>> > >>> > >>> > The Recursion is not known (depends on Database). >>> > Pls help me to build it! >>> > Thanks in advance! >>> > >>> > >>> >>> >> >> > >
- Next message: Norm: "XP Look in HTML forms in AxSHDocVw.AxWebBrowser"
- Previous message: dotnetdivis: "ErrorProvider"
- In reply to: Mark Broadbent: "Re: TreeView with Recursive TreeNode...."
- Next in thread: Iain Mcleod: "Re: TreeView with Recursive TreeNode...."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|