We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Scrolling in tree

Hi I am using treeviewadv and version 3.3. Is there any possibility to change the selection programatically from the top to bottom node of the tree. So that tree scrolls to show the bottom node. Regards, Lance

2 Replies

DT Deepa TS Syncfusion Team April 19, 2006 02:18 PM UTC

Hi Lance, You could scroll the TreeViewAdv from top to bottom by setting the last node as the SelectedNode of the tree and EnsureVisibleSelectedNode property to true. This will bring the invisible node into visible state by scrolling to the SelectedNode. And also if you select the node programmatically in button click event or any other control, TreeViewAdv will lose the focus and the selection will be hidden. So that you may need to set the HideSelection property to false for displaying the selection of the node even it lose the focus. Code: //select first node private void button1_Click(object sender, System.EventArgs e) { this.treeViewAdv1.SelectedNode=this.treeViewAdv1.Nodes[0]; //this.treeViewAdv1.Focus(); } //select last node private void button2_Click(object sender, System.EventArgs e) { this.treeViewAdv1.SelectedNode = this.treeViewAdv1.Nodes[this.treeViewAdv1.Nodes.Count-1]; //this.treeViewAdv1.Focus(); } Please take a look at the attached sample which illustrates the above functionality and let me know if this helps you. TopToBottom Thanks for your interest in Syncfusion products. Regards, Deepa


AD Administrator Syncfusion Team May 3, 2006 11:51 AM UTC

Thanks for the information about HideSelection property

Loader.
Live Chat Icon For mobile
Up arrow icon