I have tried every solution mentioned on these forums, with multiple variations, and the active node is still not highlighted (with background color) when the tree is loaded.
I set the tree data source to a dataset and expanded everything, this all works great.
I then tried several variations of the below, but the node is never highlighted.
var node = ultraTree1.GetNodeByKey("5"); ultraTree1.SelectedNodes.Clear(); node.BringIntoView(); ultraTree1.ActiveNode = node; ultraTree1.HideSelection = false; node.Selected = true;
The active node is correct and loads my list view with the related data. Even trying to override the back color didn't work. When I manually select the node, it highlights properly.
Hello Sam,
With the default implementation of the UltraTree, the tree needs to be the focused control to be able to see the active / selected node. You can override this by setting the following though:
this.ultraTree1.Override.ActiveNodeAppearance.BackColor = SystemColors.Highlight; this.ultraTree1.Override.ActiveNodeAppearance.ForeColor = Color.White;
Please let me know if you have any other questions or concerns on this matter.
Thanks for the response, but that did not work. Is there an execution order that matters? I tried various ones but nothing changes.
Is there a way to set the tree to the focused control on the form? I tried ultraTree1.Focus() but that did not help.