Home - Forums-.NET - FlyTreeView (ASP.NET) - Syntax, to add nodes

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

This forum related to following products: FlyTreeView for ASP.NET

Syntax, to add nodes
Link Posted: 26-Jun-2006 01:03
I am using VB.Net to build some web pages, However I can not find in all the help files, Samples and on line forums, and the object browser shows to pass to Add(NineRays.Web.UI.WebControls.FlyTreeView.TreeNodeCollection.Add)

a simple explination of the Syntax to add a Root node, and a child node would be so helpful.

FlyTreeView1.Nodes.Add(\"node1\", \"null\", \"VEIII\", ,)

I keep getting errors as I cant figure this out I simply would  like to add nodes in this format if it is possible

Thanks in advance for any help
Link Posted: 27-Jun-2006 14:34
Jim,
You shoul first create an object of TreeNode.
Set its Text and Key values at least.
Then use Add(node) to add created node to the nodes collection.
Link Posted: 30-Jun-2006 01:47
If you could direct me to a specific instance in the demos or jot down the four lines of code to create a node I think I would be well on my way to smiling will working with this control, Everytime I try to enter information for the key and the node it give me an error, this (string cannot be translated into a usable node)

Thank you for your help
Link Posted: 30-Jun-2006 07:45
it quite simple:
TreeNode node = new TreeNode();
node.Key = \"nodeuniquekey\";
node.Text = \"Text\";
Link Posted: 05-Jul-2006 02:18
Dear Sir,
I understand this control is very simple to use, I have pasted the code you sent, I must be missing something maybe this will help in understanding what I need

I want to Drag the control in my VB.net enviroment to a designer page, paste some code (VBCode) into the Page load event click run and walla have two, maybe three nodes, Root, Parent, and a child sitting there, I think then I could figure the rest out for the most part.

Thank you Again
Jim
Link Posted: 06-Jul-2006 02:28
OK, I'll try again

// creating node
TreeNode node = new TreeNode();
node.Key = \"nodeuniquekey\";
node.Text = \"Text\";

// add root node to flytreeview 1
flytreeview1.Nodes.Add(node);

// lets create child node
TreeNode node2 = new TreeNode();
node2.Key = \"nodeuniquekey2\";
node2.Text = \"Text2\";

// add it as a child of parent (node)
node.Nodes.Add(node2);
Link Posted: 06-Jul-2006 07:49
EvgenyT,

I must be missing a referance, or I may have intsalled something wrong when in the code window this code is underlined as is not defined?

but TreeNode is defined through a referance.....yes? as well as node

So maybe my issue revolves around this,

I am truly sry for my ignorance here

Thank you
Link Posted: 06-Jul-2006 22:45
Yes, you should declare using NineRays.Web.UI.WebControls.FlyTreeView namespace, and have the FlyTreeView control on your page.

[/list]
Link Posted: 07-Jul-2006 01:42



this is the code at the top of my .aspx page it has the NameSpace declared do I also have to declare it in the treeform.aspx.vb, which is the codebehind page? or must there be additional declarations in the Global file?

Thank you
Jim
Link Posted: 07-Jul-2006 20:25
Yes, you should declare it in your aspx.vb file.