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;
                }
            }

Parents
  • 69832
    Verified Answer
    Offline posted

    The control's HideSelection property defaults to true; assuming you executed this code at a point when the control does not have focus, selection would not be visually depicted. Try setting HideSelection to false.

Reply Children
No Data