473,387 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

TreeNodeCollection,TreeNode not defined in VS.NET HELP

I have this code below.
All its suppose to do is to EXPAND / COLLAPSE ALL of my treeview.
But when i use ASP.NET WEbmatrix it all works fine ..

But with VS.NET is says TreeNodeCollection not defined
and TreeNode not defined!!!!!!!!!!!!!!arg!!!!

How am i suppose to define it in VS.NET..
Any help appreciated!
Private Sub expandAll(ByVal sender As Object, ByVal e As EventArgs)
'Call the recursive function with the rootnode collection and a
boolean value indication to expand the nodes.
expandCollapseAllTreeviewNodes(Me.tvFamilyTree.Nod es, True)
End Sub

Private Sub collapseAll(ByVal sender As Object, ByVal e As EventArgs)
'Call the recursive function with the rootnode collection and a
boolean value indication to collapse the nodes.
expandCollapseAllTreeviewNodes(Me.tvFamilyTree.Nod es, False)
End Sub

'Recursive function.
Private Sub expandCollapseAllTreeviewNodes(ByVal nodes As
TreeNodeCollection, ByVal expand As Boolean)
Dim node As TreeNode

'Loop through each node of the collection and expand it.
For Each node In nodes
node.Expanded = expand

'Call the recursive function from itself, just the subnode
collection (this will ensure all nodes either are collapsed or expanded).
expandCollapseAllTreeviewNodes(node.Nodes, expand)

Next
End Sub

ASP.NET
-----------
<asp:Button id="Button1" onclick="expandAll" runat=server
Text="Expand"></asp:Button>
<asp:Button id="Button2" onclick="collapseAll"
Text="Collapse"></asp:Button>
Nov 18 '05 #1
0 1388

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: | last post by:
I have derived new classes for the TreeNode and TreeView classes that Microsoft provides. Since the TreeNodeCollection class is sealed I created my own class that implements the IList interface....
4
by: Chuck Bowling | last post by:
I have a serialized TreeNodeCollection that I want to initialize a TreeView with. Is there a simple assignment I can use for this or do I have to iterate thru the collection and add individual...
2
by: Dmitriy Kolesnik | last post by:
Hello, All! I have next problem: I need to override TreeNodeCollection method Add(), but I know that I can't inherited from TreeNodeCollection. How I can resolve this problem? Help me please...
1
by: naijacoder naijacoder | last post by:
Hi Guys, I have an application below that is treeview menu populated from the database which works with asp.net webmatrix.But when i put it into code behind in Visual Studio.Net it gives the...
3
by: markaelkins | last post by:
Hi. I am trying to enter a variable in the treenodesrc of a treenode. I am basically trying to send an ID variable into sql to return different records. I've searched everywhere and cannot find the...
2
by: bclegg | last post by:
Hi, When I implement the example code it errors with 'No parameterless constructor defined for this object.' experimenting with dim o as object = mytreenode.clone() gives the same error. The...
2
by: engelit.junk | last post by:
Hi, If you look at TreeNodeCollection.Find Method, you'll see: Finds the tree nodes with specified key, optionally searching subnodes. public TreeNode Find ( string key, bool...
3
by: tanya foster | last post by:
Hello, I am re-writing a visual basic .net application(visual studio 2003) in an asp.net application(visual studio 2005). The vb.net application relied on a treeview and hence, treenodes. The...
1
by: chinoo5 | last post by:
Hi everyone! I need help to cast a TreeNode into my own-defined TreeNode class (called ExtraTreeNode); the TreeNode has been added to the tree as ExtraTreeNode. For example, I have some properties...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.