Re: TreeView with Recursive TreeNode....

From: Mark Broadbent (nospam_at_nospam.com)
Date: 11/15/04


Date: Mon, 15 Nov 2004 11:38:55 -0000

LMAO heh heh. Listen mate what do you think you are doing going to the pub
without inviting me!

Hope the whisky was good. My favorites are the Western Isles ones (very
peaty) -e.g. Lagavullin. verynice :-)

-- 
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!
"Iain Mcleod" <mcleodia@dcs.gla.ac.uk> wrote in message 
news:%23iK9AtoyEHA.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!
>>>> >
>>>> >
>>>>
>>>>
>>>
>>>
>>
>>
>
> 


Relevant Pages

  • Re: TreeView Dynamic XML Binding
    ... By monitoring the treeview child nodes when I explicitly set the XmlDataSource.DataFile, I determined that the process is actually using the PopulateOnDemand processing. ... I'm going to put the xml document into a session variable. ... It seems as if the default settings are doing the populate on expand ... otherwise the entire tree reset. ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: MFC Newbie design question
    ... you could simply copy the XML Node COM pointer ... At the end of the day the tree node ... > The loaded document will be displayed in a TreeView. ...
    (microsoft.public.vc.mfc)
  • Re: TreeView with Recursive TreeNode....
    ... "Mark Broadbent" wrote in message ... > Whether this data is read in as XML or not, the tree would still ... > XML would be benefical). ... > for mirroring this in a TreeView and this is probably correct. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: TreeView with Recursive TreeNode....
    ... Whether this data is read in as XML or not, the tree would still 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 ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Modeling Data for XML instead of SQL-DBMS
    ... It is a tree, ... A set of XML documents may include ... DBMS tools where the link specifications are metadata. ... but I don't think that is the hierarchy you ...
    (comp.databases.theory)