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
907
What is the correct way to select a node and bring it into view?
posted

Most of the time the code I use works, but occassionally it does not.  So I just wanted to verify if I am coding something incorrectly or if it's a bug.  The code below is what I used to select and existing node and it seems that 95% of the time it works fine, but sometimes the selected node is at the top of the tree and I have 2-3 screens worth of information and only the very last row is visible in the tree.  This seems to also occur at the same time my headers are scrunched.  i.e. Headers take up onyl 10% of the tree width instead of the 100% they're configured to do...  I did report that bug and a fix went out, but that fix only fixed it for 95% of the time.  The previous bug report was reproducable, but the current bug wit hthe headers is not. :( 

                UltraTreeNode node = ultraTreeFields.GetNodeByKey(selectPath);

                if (node != null) {
                    //
                    // Make sure to set the active node 1st, as setting the selected will trigger
                    // events that will make use of active node.
                    //
                    ultraTreeFields.ActiveNode = node;
                    node.Selected              = true;
                    node.BringIntoView();
                }