We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

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 09:37 AM

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

Loader.
Live Chat Icon For mobile
Up arrow icon