I have expanded on this example because I needed cyclical navigation in the treeview, but I’m running into issues.
If the user is at the top of the tree and they click btnup they should move to the bottom (last node) in the tree, and if the user is at the bottom of the tree and click btndown they should move to the top of the tree.
Moving to the top of the tree works fine. I just get the root node of the tree and select it, but for some reason I cannot get the last node of the tree.
Here is the code I added…
In btnup_click add this else condition to the last if statement.
this.tvwrDocVariables.SelectedNode = selectedNode.RootNode;
In the btndown_click add this else condition to the last if statement.
this.tvwrDocVariables.SelectedNode = this.tvwrDocVariables.LastVisibleNode;
Oh… I also implimented your scrollhelper class from a previous post.
The LastVisibleNode call in the btndown returns a null value for the node. What am I doing wrong?