<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Internet Explorer Web Controls</title><link>http://forums.asp.net/91.aspx</link><description>General discussion of the Internet Explorer Web Controls source package for ASP.NET 1.x.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Adding TreeNodes of TreeView Dynamically....</title><link>http://forums.asp.net/thread/2876694.aspx</link><pubDate>Mon, 19 Jan 2009 13:46:49 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2876694</guid><dc:creator>Chryzo</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2876694.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=91&amp;PostID=2876694</wfw:commentRss><description>&lt;p&gt;@ recursivity thingy&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you have a SQL Server (2005 +) there is a really nice clause to help you with recursivity problem, it is the WITH clause, see example D of: &lt;a href="http://msdn.microsoft.com/en-us/library/ms175972.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms175972.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;As for the other problem, dunno.&lt;/p&gt;
&lt;p&gt;Personaly I am trying to add child nodes when client clicks on parent node, but even though it is adding the node, it ain&amp;#39;t showing up on the client. (I use a debug label to count the number of childnodes added to the parent node and it shows the increase)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Hope it helps in regards to recursivity&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Edit: Note that I do not want to add everything right of the bat ti minimize the response time and the load on the sql server&lt;/p&gt;
&lt;p&gt;Edit2: sorry for the necro, forgot to look up the date before posting&lt;/p&gt;</description></item><item><title>Re: Adding TreeNodes of TreeView Dynamically....</title><link>http://forums.asp.net/thread/1021765.aspx</link><pubDate>Tue, 16 Aug 2005 07:07:47 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1021765</guid><dc:creator>prem_rajani</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1021765.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=91&amp;PostID=1021765</wfw:commentRss><description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I'm populating my treeview from SQL database. My table design is as follows:&lt;/P&gt;
&lt;P&gt;MenuId&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp; MenuName&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp; MenuUrl&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp; MenuType&amp;nbsp; | MenuParent &lt;BR&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Alert&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;----&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;root&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0&lt;BR&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Safety&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; document&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;BR&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Precaution&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; folder&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2&lt;BR&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Caution&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; folder&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3&lt;BR&gt;&lt;BR&gt;Each menu is linked to its parentid through Menuparent column. My problem is how to make the coding very dynamic. The treelevel could go upto 6-7 levels. The coding I have written is:&lt;BR&gt;&lt;BR&gt;&lt;FONT size=2&gt;TVMenu.ImageUrl = "../Images/folder.gif"&lt;BR&gt;TVMenu.SelectedImageUrl = "../Images/folderopen.gif"&lt;BR&gt;TVMenu.Visible = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;True&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;da = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; SqlDataAdapter("select * from menutrees where MenuType='root'", conn)&lt;BR&gt;da.Fill(dsRoot, "menutrees")&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;For&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Each&lt;/FONT&gt;&lt;FONT size=2&gt; rowRoot &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;In&lt;/FONT&gt;&lt;FONT size=2&gt; dsRoot.Tables("menutrees").Rows&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;nodeRoot = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; TreeNode&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;nodeRoot.Text = rowRoot("MenuName")&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;nodeRoot.Type = rowRoot("MenuType")&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;nodeRoot.NavigateUrl = rowRoot("MenuUrl")&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;nodeRoot.ImageUrl = "../Images/root.gif"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;nodeRoot.SelectedImageUrl = "../Images/root.gif"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;strid = rowRoot("MenuId")&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;TVMenu.Nodes.Add(nodeRoot)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;da = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; SqlDataAdapter("select * from menutrees where menuparent=" &amp;amp; strid &amp;amp; " ", conn)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;da.Fill(dsChild1, "menutrees")&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;For&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Each&lt;/FONT&gt;&lt;FONT size=2&gt; rowChild1 &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;In&lt;/FONT&gt;&lt;FONT size=2&gt; dsChild1.Tables("menutrees").Rows&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;nodeChild1 = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; TreeNode&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;nodeChild1.Text = rowChild1("MenuName")&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;nodeChild1.Type = rowChild1("MenuType")&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'nodeChild1.NavigateUrl = rowChild1("MenuUrl")&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;If&lt;/FONT&gt;&lt;FONT size=2&gt; nodeChild1.Type = "document" &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Then&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;nodeChild1.ImageUrl = "../Images/doc.gif"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;nodeChild1.SelectedImageUrl = "../Images/doc.gif"&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;strid = rowChild1("MenuId")&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;nodeRoot.Nodes.Add(nodeChild1)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;da = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; SqlDataAdapter("select * from menutrees where menuparent=" &amp;amp; strid &amp;amp; " ", conn)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;da.Fill(dsChild2, "menutrees")&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;For&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Each&lt;/FONT&gt;&lt;FONT size=2&gt; rowChild2 &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;In&lt;/FONT&gt;&lt;FONT size=2&gt; dsChild2.Tables("menutrees").Rows&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;----&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;----&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;----&lt;BR&gt;&lt;BR&gt;So u guyz must have got an idea what I'm trying to do. I tried writing it as a procedure which will call itself. The problem is if any child record is present then datareader updates the dataset thereby old looping is lost and new loop begins.&amp;nbsp;I hope you understood my problem. If anyone can give me some ideas how to go about I would appreciate.&lt;/P&gt;&lt;/FONT&gt;</description></item><item><title>Re: Adding TreeNodes of TreeView Dynamically....</title><link>http://forums.asp.net/thread/1016391.aspx</link><pubDate>Wed, 10 Aug 2005 15:46:10 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1016391</guid><dc:creator>Dmerayo</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1016391.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=91&amp;PostID=1016391</wfw:commentRss><description>&lt;FONT face=Arial size=2&gt;Hi,&lt;BR&gt;&lt;BR&gt;You need to look for the node in the level you add it.&lt;BR&gt;&lt;BR&gt;Your example would be:&lt;BR&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;TreeView tree = new TreeView();&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;&amp;nbsp; &amp;nbsp;TreeNode userTools = new TreeNode();&lt;BR&gt;&amp;nbsp;&amp;nbsp; userTools.Text="User Tools";&lt;BR&gt;&amp;nbsp; &amp;nbsp;tree.Nodes.Add(userTools);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp; &amp;nbsp;TreeNode userTool1 = new TreeNode();&lt;BR&gt;&amp;nbsp;&amp;nbsp; userTool1.Text="User Tool 1";&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;tree.Nodes[tree.Nodes.IndexOf(userTools)].Nodes.Add(userTool1);&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&amp;nbsp;&amp;nbsp; // tree.Nodes[0].Nodes.Add(userTool1); // This also works&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; TreeNode userTool2 = new TreeNode();&lt;BR&gt;&amp;nbsp; &amp;nbsp;userTool2.Text="User Tool 2"; &lt;BR&gt;&amp;nbsp;&amp;nbsp; tree.Nodes[tree.Nodes.IndexOf(userTools)].Nodes[userTools.Nodes.IndexOf(userTool1)].Nodes.Add(userTool2);&lt;BR&gt;&amp;nbsp;&amp;nbsp; // tree.Nodes[0].Nodes[0].Nodes.Add(userTool2); // This also works&lt;BR&gt;&lt;BR&gt;this.Controls.Add(tree);&lt;BR&gt;&lt;BR&gt;Remember the structure and hierarchy of the tree, in this case userTools belongs to the tree, but userTool1 belongs to userTools and userTool2 to userTool1&lt;BR&gt;I hope it helps&lt;BR&gt;&lt;BR&gt;Regards,&lt;BR&gt;Diego Merayo&lt;/FONT&gt;&lt;/P&gt;</description></item><item><title>Re: Adding TreeNodes of TreeView Dynamically....</title><link>http://forums.asp.net/thread/1013180.aspx</link><pubDate>Mon, 08 Aug 2005 08:51:24 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1013180</guid><dc:creator>TomasF</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1013180.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=91&amp;PostID=1013180</wfw:commentRss><description>&lt;P&gt;Hello!&lt;/P&gt;
&lt;P&gt;I have the same problem, did you ever find a solution?&lt;BR&gt;&lt;BR&gt;This is my code:&lt;/P&gt;
&lt;P&gt;TreeView tree = new TreeView();&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;TreeNode userTools = new TreeNode();&lt;BR&gt;&amp;nbsp;&amp;nbsp; userTools.Text="User Tools";&lt;BR&gt;&amp;nbsp; &amp;nbsp;tree.Nodes.Add(userTools);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp; &amp;nbsp;TreeNode userTool1 = new TreeNode();&lt;BR&gt;&amp;nbsp;&amp;nbsp; userTool1.Text="User Tool 1"; &lt;BR&gt;&amp;nbsp; &amp;nbsp;tree.Nodes[tree.Nodes.IndexOf(userTools)].Nodes.Add(userTool1);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; TreeNode userTool2 = new TreeNode();&lt;BR&gt;&amp;nbsp; &amp;nbsp;userTool2.Text="User Tool 2"; &lt;BR&gt;&amp;nbsp;&amp;nbsp; tree.Nodes[tree.Nodes.IndexOf(userTool1)].Nodes.Add(userTool2);&lt;BR&gt;&lt;BR&gt;this.Controls.Add(tree);&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;I am able to add userTool1 to userTools, but when I&amp;nbsp;want to add userTool2 to userTool1, I can't, because userTool1 has an index of -1(not assigned).&lt;/P&gt;</description></item><item><title>Adding TreeNodes of TreeView Dynamically....</title><link>http://forums.asp.net/thread/812070.aspx</link><pubDate>Sat, 29 Jan 2005 02:49:19 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:812070</guid><dc:creator>alecd</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/812070.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=91&amp;PostID=812070</wfw:commentRss><description>Hello everyone,
&lt;br /&gt;

&lt;br /&gt;
I've reached a dead end right now trying to get my TreeNodes to load dynamically. 
&lt;br /&gt;

&lt;br /&gt;
I start by adding a base node as a starting point.
&lt;br /&gt;

&lt;br /&gt;
&lt;pre&gt;
&lt;br /&gt;
        Dim trnBase As New TreeNode
&lt;br /&gt;
        trnBase.Text = &amp;quot;Search&amp;quot;
&lt;br /&gt;
        tvw_Search.Nodes.Add(trnBase)
&lt;br /&gt;
&lt;/pre&gt;
&lt;br /&gt;

&lt;br /&gt;
At this point there are no problems. trnBase has been added to tvw_Search. And the indexOf property of trnBase has been set to 0 (which will be used later in this subroutine).
&lt;br /&gt;

&lt;br /&gt;
Later on in this same subroutine I itterate through a DataTable containing my Nodes. Each itteration I check the ParentNodeIndex value. I then use that to get the ParentNode from the node collection of tvw_Search. Then I add the record as a node to the ParentNode.
&lt;br /&gt;

&lt;br /&gt;
&lt;pre&gt;
&lt;br /&gt;
        Dim intParentNodeIndex As Integer = drRow(4)
&lt;br /&gt;

&lt;br /&gt;
        Dim trnChildNode As New TreeNode
&lt;br /&gt;
        trnChildNode.Text = drRow(7)
&lt;br /&gt;

&lt;br /&gt;
        Dim trnParentNode As New TreeNode
&lt;br /&gt;
        trnParentNode = tvw_Search.Nodes.Item(intParentNodeIndex)
&lt;br /&gt;
        trnParentNode.Nodes.Add(trnChildNode)
&lt;br /&gt;
&lt;/pre&gt;
&lt;br /&gt;

&lt;br /&gt;
Now this is where I have trouble. The problem lies in the IndexOf property of the child nodes. When I added trnBase (the first set of code) trnBase gets assigned &amp;quot;IndexOf = 0&amp;quot;. However, the nodes that are added via the Database (the second set of code) are not assigned an IndexOf value.
&lt;br /&gt;

&lt;br /&gt;
In other words, in my DataTable the first 5 records have &amp;quot;ParentIndexOf = 0&amp;quot;. They are added to trnBase (indexOf = 0) no problem because trnBase was assigned an Index value of 0. The problem begins when I try to add nodes to these 5 new nodes. These 5 new nodes were never assigned an IndexOf value. Not only that, they aren't recognized in the tvw_Search nodes collection. When I do a &amp;quot;For each node in&amp;quot; tvw_Search, it only loops once for Node &amp;quot;trnBase&amp;quot;, even though the first 5 records were added to &amp;quot;trnBase&amp;quot;.
&lt;br /&gt;

&lt;br /&gt;
The only difference that could make any difference in my code is the last line in each set:
&lt;br /&gt;
&lt;pre&gt;
&lt;br /&gt;
tvw_Search.Nodes.Add()
&lt;br /&gt;

&lt;br /&gt;
trnBase.Nodes.Add()
&lt;br /&gt;
&lt;/pre&gt;
&lt;br /&gt;

&lt;br /&gt;
Is there something different I have to do as far as adding nodes to nodes to that of nodes to Trees? 
&lt;br /&gt;

&lt;br /&gt;
Thank you for any help.
&lt;br /&gt;

&lt;br /&gt;
Alec</description></item></channel></rss>