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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

populating nodes in the TreeViewAdv

Thread ID:





41392 Mar 1,2006 05:52 AM UTC Mar 6,2006 12:22 PM UTC WinForms 2
Tags: Tools
Administrator [Syncfusion]
Asked On March 1, 2006 05:52 AM UTC

Hi forum, I need to populate nodes in the TreeViewAdv when a button is clicked and certain node; for example if there are 5 populated nodes, the third node should be the first selected node not the first node. I don''t know what I am missing. Its not working for me. Please help. Thanks, regards, Peter

Deepa TS [Syncfusion]
Replied On March 1, 2006 09:18 AM UTC

Hi Peter, When a button is clicked you can populate the treeViewAdv with nodes and set needed node as the first visible Node, using the following code snippet. private void button1_Click(object sender, System.EventArgs e) { //Populating Root Nodes and the child Nodes in the treeViewAdv. this.treeViewAdv1.Nodes.Add(new Syncfusion.Windows.Forms.Tools.TreeNodeAdv("Tools")); this.treeViewAdv1.Nodes[0].Nodes.Add(new Syncfusion.Windows.Forms.Tools.TreeNodeAdv("TreeViewAdv")); this.treeViewAdv1.Nodes.Add(new Syncfusion.Windows.Forms.Tools.TreeNodeAdv("Pdf")); this.treeViewAdv1.Nodes[1].Nodes.Add(new Syncfusion.Windows.Forms.Tools.TreeNodeAdv("Barcode")); this.treeViewAdv1.Nodes.Add(new Syncfusion.Windows.Forms.Tools.TreeNodeAdv("HTMLUI")); this.treeViewAdv1.Nodes[2].Nodes.Add(new Syncfusion.Windows.Forms.Tools.TreeNodeAdv("HTML tables")); this.treeViewAdv1.Nodes.Add(new Syncfusion.Windows.Forms.Tools.TreeNodeAdv("Chart")); this.treeViewAdv1.Nodes[3].Nodes.Add(new Syncfusion.Windows.Forms.Tools.TreeNodeAdv("Chart Legend")); this.treeViewAdv1.Nodes.Add(new Syncfusion.Windows.Forms.Tools.TreeNodeAdv("Grid")); this.treeViewAdv1.Nodes[4].Nodes.Add(new Syncfusion.Windows.Forms.Tools.TreeNodeAdv("Cell Types")); //Setting the First Visible Node this.treeViewAdv1.SelectedNode=this.treeViewAdv1.Nodes[3]; //Setting HelpText for the selected Node this.treeViewAdv1.SelectedNode.HelpText="First Visible Node"; //Setting Focus for the treeviewAdv this.treeViewAdv1.Focus(); } Please take a look at the attached sample and let me know if this helps you. Thanks for your continued interest in Syncfusion products. Regards, Deepa.T.S


Administrator [Syncfusion]
Replied On March 6, 2006 12:22 PM UTC

Thanks for the sample. It helped me


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon