Adding Child Nodes

Hi, I am trying to recursively add nodes to the treeviewadv control. What I need is a way to get the index of the last node added to the tree so that any children can be appropriately added to the Nth child. I am using the following code which is not working.. Any help is appreciated. ''-- Get data dbSubCategoryInfo = dbSubCategory.GetData(iCatID) ''-- Prep for loop iArrayLen = UBound(dbSubCategoryInfo) ''-- Add Child Nodes For iNdx = 0 To iArrayLen oNode = New TreeNodeAdv oNode.Text = dbSubCategoryInfo(iNdx).Name oNode.Tag = CStr(dbSubCategoryInfo(iNdx).ID) ''-- Add the new node to the tree.. If iNode < 0 Then iNode = oTree.Nodes.Add(oNode) Else iNode=oTree.Nodes(iNode).Nodes.Add(oNode) End If ''-- Load any child nodes...(recurse) LoadChildNodes(oTree, dbSubCategoryInfo _ (iNdx).ID, iNodeIndex) Next

1 Reply

AD Administrator Syncfusion Team November 10, 2004 02:37 PM UTC

Nevermind... figured it out.. thanks..

Loader.
Up arrow icon