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
760
After setting top node tree doesnt scroll topnode into view
posted

Hello,

I found a great example of setting the top node in hopes that after running the code that topnode that i set on the ultraTreeView would actually scroll to the top.

I can see in the debugger that I correctly set the property but it still somehow scrolls all the way to the top.

Heres the code I use. Do I need to refresh or do anything else to get this to work? Any help would be great. Thanks


        public void RebuildTree()
        {

            UltraTreeNode topNode = ultraTreeView1.GetNodeByKey(_TopNodeKey);
            // Load the tree
            PopulateDesignAltsTreeNode();

            // Process all context events
            DoAllContextEvents();

            if (topNode != null)
                ultraTreeView1.TopNode = topNode;
        }

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi, 

    I don't know what the methods you have here are doing. But the first one is pretty suspicious.

    My first guess, just from looking at the name of the method, is that this method is re-populating the tree. It's probably removing all of the nodes from this tree and adding new nodes. Which means that the topNode variable you stored is referring to a node that is no longer a part of this tree. You probably need to call GetNodeByKey after you populate the tree. Assuming that the tree was populated with a node that has the same key, it should work.

Children