473,385 Members | 1,908 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,385 software developers and data experts.

How to expand the node?

Is it possible or is there a method for a treeview to expand down to the
node by giving the node?

Eg.
I was given a node say at level 3 and would like to expand at that node.
Jul 20 '06 #1
4 1602
I am not sure if there is a specific function for doing that, but you
could use recursion to iterate through each collection until it found
the node, and then as each recursive step exits, expand the holding
node.
Alan T wrote:
Is it possible or is there a method for a treeview to expand down to the
node by giving the node?

Eg.
I was given a node say at level 3 and would like to expand at that node.
Jul 20 '06 #2
You need to count upwards from the Node to the top of the TreeView, and then
work your way back down. This can be done by checking the Parent property
for each Node. When the Parent returns null, you're at the top.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

What You Seek Is What You Get.
"Alan T" <al*************@yahoo.com.auwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Is it possible or is there a method for a treeview to expand down to the
node by giving the node?

Eg.
I was given a node say at level 3 and would like to expand at that node.

Jul 20 '06 #3
Try the EnsureVisible method.

/claes

"Alan T" <al*************@yahoo.com.auwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Is it possible or is there a method for a treeview to expand down to the
node by giving the node?

Eg.
I was given a node say at level 3 and would like to expand at that node.

Jul 20 '06 #4
Just set given node Property Selected to true, the treeview will expand

/Lennart
"Alan T" <al*************@yahoo.com.auskrev i meddelandet
news:%2****************@TK2MSFTNGP03.phx.gbl...
Is it possible or is there a method for a treeview to expand down to the
node by giving the node?

Eg.
I was given a node say at level 3 and would like to expand at that node.

Jul 21 '06 #5

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

Similar topics

2
by: Stephen | last post by:
In asp.net 1.1, the IE treeview web control has a property called "SelectExpands" that, when set to true, expands a node when a user clicks the node text. I can't seem to replicate this in the...
4
by: Karim El Jed | last post by:
Hi, I'm trying to expand a special Node of my TreeView from Codebehind. I have a TreeView on a page for navigating to another site. On the other tsite here is the same TreeView more precisely a...
1
by: SamSpade | last post by:
I want to expand nodes on a treeview. What I have is an array (SubFolder) of node.text not index. What I'd like to do is the folowing: lKey = tvFolders.Nodes(0) ) 'Not in SubFolder For...
3
by: Sam | last post by:
Hi, I'd like to select a node in my code and expand that node. How can I do the selection ? How can I expand it once I've selected the node ? Thx
2
by: Sam | last post by:
Hi, Say I have the following Treeview : N1 |-N11 |-N12 |-N121 |-N122 N2 |-N21
0
by: Shadow Lynx | last post by:
When using ASP.NET 2.0's built-in TreeView on a page with <BASE target = "AnythingBut_Self"></BASE> in the HEAD, the expand/collapse buttons fail to function. The reason for this is that the...
1
by: Dave | last post by:
I have a TreeView on a Web Page. OK...Big Deal. It's based on a Web.sitemap. Everything's ok so far. Works Great...except when a person selects a specific Node, the new page loads Tree is all...
4
by: RP | last post by:
I have a TreeView control. When a user clicks on a node, it must change color. I did: TreeView1.SelectedNode.ForeColor = colors.Blue; However, it must change the other nodes color to black,...
4
by: Marcolino | last post by:
Hi I have a little problem with Treeview expand. So I'll try to explain. I Have one node and some subnodes like this +Nodes1 |------Subnodes 1 |------Subnodes 2 +Nodes2
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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.