473,471 Members | 1,905 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Collapse sibling nodes in 2.0 Treeview

Howdy folks. Would anyone care to suggest a way to have sibling nodes
(at the same level) collapse when a node is expanded in an asp.net 2.0
treeview control? What I mean is that I want only one subtree to be
open at a time. Can the treeview control do this by itself or is some
fiddeling required?

Regards,
Lantz

Feb 15 '06 #1
1 1803
Hello Christopher,

My experience with the Treeview would say that you need to manage the state
of the nodes yourself and that Treeview.FindNode() is your friend:

// Function to collapse all the nodes of a treeview control but the given
parameter

protected void ExpandNode(string expandThisNode)
{
foreach (TreeNode tn in myTreevie.Nodes)
{
tn.Collapse();
}
TreeNode tnExpandThisNode = tvPhoto.FindNode((string)expandThisNode);
tnExpandThisNode.Expand();
}

--
brians
http://www.limbertech.com
"ch***************@gmail.com" wrote:
Howdy folks. Would anyone care to suggest a way to have sibling nodes
(at the same level) collapse when a node is expanded in an asp.net 2.0
treeview control? What I mean is that I want only one subtree to be
open at a time. Can the treeview control do this by itself or is some
fiddeling required?

Regards,
Lantz

Feb 16 '06 #2

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

Similar topics

7
by: peter | last post by:
I use the click-to-expand menu at http://javascript.internet.com/navigation/click-to-expand-menu.html This works fine, but is there a way to expand or collapse all the menus? An example of how...
4
by: Gönen EREN | last post by:
how can i collapse or expand a node of treeview control programmaticly? thanks.
1
by: Edwin Knoppert | last post by:
I'm using a simple treeview for helpsystem. The treeview is on a masterpage, right beside it it has the container. The user uses the treeview to navigate to helppages using this masterpage. But on...
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...
0
by: jim | last post by:
Hi, I have a TreeView control that sits on the MasterPage. All of my other webpages inherit from that Master Page. The Treeview receives it's data using an XMLDataSource that has it's DataFile...
0
by: Tor Inge Rislaa | last post by:
I need to expand/collapse TreeView nodes to show/hide childnodes by clikcing on the node text (instead of using the expand/collapse icon). Does anyone know how to do that? (What property has to be...
1
by: pej.odonnell | last post by:
Hello everyone, 2 Issues: 1. When treeview renders all parent nodes are open? I want it to render closed? 2. When I try to collapse programmatically, it does not do anything? I'm using a...
0
by: Marc Bartsch | last post by:
Hi, I have a WinForms application (C#, VS 2005) that consists of a treeview control and a notify icon. Below is a complete example of this application. The treeview has one root node and one child...
2
by: dutsnekcirf | last post by:
I found this article on how to nudge the treenode items up or down in the order of a treeview control. The problem is it's in C# and I know nothing about C#. In fact, C# scares me (I think it's the...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.