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
165
UltraTreeNode.Selected = true does not make the node appear selected
posted

I'm using this code to find an existing node it the tree. I want the found node to appear selected/blue to the user, just as if the user clicked it with the mouse. Once this code executes, the UltraTree.SelectedNodes collection contains the node that I set UltraTreeNode.Selected, but the node still does not appear blue to the user.

What am I doing wrong?

            this._tree.SelectedNodes.Clear();
            this._tree.CollapseAll();
            foreach (var node in this._tree.Nodes)
            {
                if (node.Text.Equals(this._searchTextbox.Text, StringComparison.OrdinalIgnoreCase))
                {
                    this._tree.ActiveNode = node;
                    node.Selected = true;
                    break;
                }
            }