Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
120
Get Parent Node
posted

 I am using the following code to get the node a user clicks on.  I also want to get the parent node of the node the user clicked on.  

 

 Private Sub UltraTree1_MouseUp(ByVal sender As Object, _
      ByVal e As System.Windows.Forms.MouseEventArgs) _
      Handles ultratree1.MouseUp
        Dim tree As UltraTree
        tree = DirectCast(sender, UltraTree)

        Dim aNode As UltraTreeNode
        Dim parentNode As UltraTreeNode '// Parent node variable of node users clicked

       aNode = tree.GetNodeFromPoint(e.X, e.Y) '// Establish node users clicked

       If (Not aNode Is Nothing) Then
            Me.UltraTextEditor1.Text = aNode.Text  '// dump anode variable to editor

       End If

       '// Now that we know the node the user clicked on.
       '// Need code to get the parent node of the node the user clicked.

             
       
        Me.UltraTextEditor2.Text = parentNode.text  '// Display parentNode variable in editor


        'End If

    End Sub

Parents Reply Children
No Data