I'm having issues with iteriating treenodes.

I've got a database table with the following columns:
CategoryID
CategoryName
ParentID

I set the Node name to CategoryID and the .Tag property to the ParentID.

Items with ParentID = 0, Tag is Nothing.

Now, I iteriate through nodes and start moving them around:
Code:
        For Each mNode As TreeNode In control.Nodes
            If Not IsNothing(mNode.Tag) Then
                mNode.Remove()
                'control.Nodes(mNode.Tag.ToString).Nodes.Add(mNode)
                MsgBox(mNode.Tag)
                control.Nodes(control.Nodes.IndexOfKey(mNode.Tag)).Nodes.Add(mNode)
            End If
        Next

The issue is that for some reason, it won't add more than 2 child nodes to a parent. Even though the data is right.

Heres what the result looks like:
+ Windows
-Security
-Productivity
+ Ubuntu
-Design
+Tools

Heres what is should be:
+ Windows
-Security
-Productivity
-Tools
+Ubuntu
-Design