Note that there are some explanatory texts on larger screens.

plurals
  1. POVB.Net Treeview "Rollback"
    primarykey
    data
    text
    <p>I am populating a tree view dynamically so I do not know the amount of levels I may have.</p> <p>Is there a way to rollback to the previous level? Here is a sample of my code:</p> <pre><code>Private Sub RecursiveTreeAssembly(FileName As String, node As TreeNodeCollection) 'Sets sFileNamePath to correct path value FileNameToFilePath(FileName) 'Start SolidEdge StartSolidEdge() 'Open document OpenSolidEdgeDocument(sFileNamePath) 'Get the parts list for the opened document (FileName) partList = clsPartInformation.GetAll() 'Populate tree View If partList.Count &gt; 0 Then 'PartsList retrieved, close document CloseSolidEdgeDocument(FileName) 'Go through all part lists and display them in tree view For i As Integer = 0 To partList.Count - 1 'Is it Assembly, Parametric, Material, Part to buy If IsAssembly(partList(i).Part_No) Then node(iterator).Nodes.Add(partList(i).Part_No) ElseIf IsMaterial(partList(i).Part_No) Then node(iterator).Nodes.Add(partList(i).Part_No) ElseIf IsPart(partList(i).Part_No) Then node(iterator).Nodes.Add(partList(i).Part_No) End If tvDessins.ExpandAll() Next End If 'Go through tree view to populate it While iterator &lt; tvDessins.Nodes(0).Nodes.Count If rollback Then node = tvDessins.Nodes currFileName = node(0).Nodes.Item(iterator).Text Else currFileName = node(iterator).Nodes.Item(0).Text End If If IsAssembly(currFileName) Then rollback = False 'Call itself again RecursiveTreeAssembly(currFileName, node(0).Nodes) Else 'Rollback nodes rollback = True End If iterator += 1 End While End Sub </code></pre> <p>tvDessin is my tree view. In the following code, I will iterate through a tree view that has been given some items recursively. My parts list contains the part number, that works great.</p> <p>It is during my rollback that I set the tree nodes to the beginning: node = tvDessins.Nodes</p> <p>Instead of simply going to the parent node ... That's what I'm looking to achieve!</p> <p>Thank you, sorry for such a long post.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload