Re: TreeView with Recursive TreeNode....
From: Alex (chipheo2k_at_mail.ru)
Date: 11/15/04
- Next message: Claes Bergefall: "Re: datagrid enter key handler"
- Previous message: Norm: "Re: XP Look in HTML forms in AxSHDocVw.AxWebBrowser"
- In reply to: Iain Mcleod: "Re: TreeView with Recursive TreeNode...."
- Next in thread: Mark Broadbent: "Re: TreeView with Recursive TreeNode...."
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 15 Nov 2004 11:09:08 +0300
Thank all so much!
I have successfully written by using Hashtable in a traditional programming
style.
"Iain Mcleod" <mcleodia@dcs.gla.ac.uk> сообщил/сообщила в новостях
следующее: news:#iK9AtoyEHA.3120@TK2MSFTNGP12.phx.gbl...
> Sorry. I was fresh from the pub when I wrote that. No wonder you were
all
> wondering what planet I was on...
> <grin>
>
> XML would not be particularly helpful in this case. I've been working a
lot
> with webby stuff and xslt recently and for some reason got it into my head
> that he was trying to output a tree in html, forgetting I was looking at a
> windoes forms forum. (Possibly the whisky consumed had something to do
with
> this!)
>
> As Mark says, a function to build up the tree nodes would still have to
be
> written. The xml would possibly give you an advantage in already having a
> tree-like structure, but not much of an advantage, esp. if you are not
used
> working to it (although I would take the trouble to learn it anyway at
some
> point as it is pretty useful for most stuff).
>
> Sorry to confuse.
>
> Iain (sober!)
>
>
> "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: Claes Bergefall: "Re: datagrid enter key handler"
- Previous message: Norm: "Re: XP Look in HTML forms in AxSHDocVw.AxWebBrowser"
- In reply to: Iain Mcleod: "Re: TreeView with Recursive TreeNode...."
- Next in thread: Mark Broadbent: "Re: TreeView with Recursive TreeNode...."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|