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.
Unfortunately, activation email could not send to your email. Please try again.

populating nodes in the TreeViewAdv

Thread ID:

Created:

Updated:

Platform:

Replies:

41392 Mar 1,2006 12:52 AM Mar 6,2006 07:22 AM Windows Forms 2
loading
Tags: Tools
Administrator [Syncfusion]
Asked On March 1, 2006 12:52 AM

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 04:18 AM

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

PopulateNodes.zip

Administrator [Syncfusion]
Replied On March 6, 2006 07:22 AM

Thanks for the sample. It helped me

CONFIRMATION

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.

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.

;