The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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