I have a two Ultratree controls...the first tree control is on a form that is restricted in height and width. So I have a popup component that floats over the form and the height and width is much bigger to all the user to see more detail of the data. The goal is that when I select a node from the popup form is that it is transfered back to the original form. I have an event that passes back the selectednodes collection. I was trying to loop through the orignal tree and have not been able to find anything on how I would programically select the original tree with the same selection from the popup tree.
Thanks for any help on this
Public Sub SetSelectedNode(ByVal selectedNodes As SelectedNodesCollection)
For Each node As UltraWinTree.UltraTreeNode In selectedNodes
If node.Selected Then
For Each treenode As UltraWinTree.UltraTreeNode In ResultsTree.Nodes
If node.FullPath = treenode.FullPath Then 'NOTE problem with this is some node paths with the same name.
'ResultsTree.ActiveNode.Selected = True 'NOTE Doesn't work
'ResultsTree.Nodes.Item(treenode.Key).Selected = True 'NOTE not sure this work plus I don't have the key set and dont know how.
End If
Next
End Sub
rrober07 said:'ResultsTree.ActiveNode.Selected = True 'NOTE Doesn't work
What exactly is not working? Is the Selected property not return true after you set it?
My guess is that your code is working fine, but you just don't see the selected nodes in the tree because the tree does not have focus. Try setting HideSelection on the tree to false or activating the tree control so that you can see the selection.
I am not able to select a particular node. Even after setting node.Selected=true, when I check the node.Selected value , it still remains as false
Hi,
I have a similar issue that I had already a node with the key however trying to add a new node with similar key, not able to find out the existing node with the below info.
GetNodeByKey(prntNode.Key)
always it returns false.please help