473,624 Members | 2,122 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

asp.net 2.0 treeview control expand with select

In asp.net 1.1, the IE treeview web control has a property called
"SelectExpa nds" that, when set to true, expands a node when a user
clicks the node text. I can't seem to replicate this in the treeview
control in .net 2.0. Anyone know of way to expand a node when a users
clicks the node text?

Nov 19 '05 #1
2 2422
Hi Stephen,

you can use TreeView1.Expan dAll() to expand the entire tree view control on
the click on root item. and analogous to it, you can also collapse using
CollapseAll() method. Howver, this will expand or collapse all.

You can as well expand single node some where down the line.

"Stephen" wrote:
In asp.net 1.1, the IE treeview web control has a property called
"SelectExpa nds" that, when set to true, expands a node when a user
clicks the node text. I can't seem to replicate this in the treeview
control in .net 2.0. Anyone know of way to expand a node when a users
clicks the node text?

Nov 19 '05 #2
Found this finally. you have to do a databinding, and within that
there is a SelectAction property. This needs to be ste to SelectExpand
or Expand. Expand only expands or contracts the node, which is what I
want. here is a sample of the treeview control:

<asp:TreeView ID="TreeView2" Runat="server" Width="21%"
Height="100%"
Font-Size="10pt" DataSourceID="S iteMapDataSourc e1"
ForeColor="Blac k" ExpandDepth="0"
BorderStyle="No ne" BackColor="Tran sparent"
Font-Names="Tahoma;v erdana;arial"
NodeIndent="15" AutoGenerateDat aBindings="Fals e">
<LeafNodeStyl e ForeColor="Blac k"></LeafNodeStyle>
<HoverNodeSty le Font-Bold="False" ForeColor="#666 6AA"
Font-Underline="True "></HoverNodeStyle>
<SelectedNodeSt yle Font-Underline="Fals e"
HorizontalPaddi ng="0px"
VerticalPadding ="0px" />
<NodeStyle Font-Names="Tahoma" Font-Size="8pt"
ForeColor="Blac k" HorizontalPaddi ng="2px"
NodeSpacing="0p x" VerticalPadding ="2px" />
<ParentNodeStyl e ForeColor="Blue " />
<RootNodeStyl e ForeColor="Blue " />
<DataBindings >
<asp:TreeNodeBi nding DataMember="Sit eMapNode"
NavigateUrlFiel d="Url" SelectAction="E xpand" TextField="Titl e" />
</DataBindings>
</asp:TreeView>

Works perfectly...

Stephen wrote:
In asp.net 1.1, the IE treeview web control has a property called
"SelectExpa nds" that, when set to true, expands a node when a user
clicks the node text. I can't seem to replicate this in the treeview
control in .net 2.0. Anyone know of way to expand a node when a users
clicks the node text?


Nov 19 '05 #3

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

Similar topics

4
2237
by: John Winterbottom | last post by:
I've a requirement for a treeview control to display a master-detail view. So instead of the old the old 'ActiveX + 1,000 lines of code' method that I've used in the past. I decided to try a different approach. This is a very simple idea so I'd be surprised if it hasn't been done before - but I couldn't find anything in google, so here it is if anyone is interested. The idea is to use a union query, where the first part of the union...
1
9958
by: James L | last post by:
Hi, I have a treeview that has to be refreshed due to data changes. Is it possible to select the last node that they were viewing when the tree view was been populated once again? I have tried getting the selected node and then expanding it in the refreshed tree view using expand() but it does not do it. Thanks for any help.
2
7491
by: Tymbow | last post by:
I'm building a web application that is analogous to the Windows XP file explorer in function. The left column contains a TreeView, and the right column a DataGrid populated by selecting TreeView nodes. The TreeView populates dynamically as there are a significant number of nodes. The DataGrid displays both the items and the nodes from the TreeView. Using the explorer analogy this means the TreeView shows folders, and the DataGrid folders...
8
12748
by: Matt MacDonald | last post by:
Hi All, I have a form that displays hierarchical categories in a treeview. Ok so far so good. What I was to do is have users be able to select a node in the treeview as part of filling out the form. I only want to allow single selection, so using checkboxes is out of the question. It works as is, but it makes the form very cumbersome if every time that a user selects a node, the whole page has to reload. Is there a way to have a node...
1
4917
by: doemon | last post by:
Hi, I'm working on a pagination control and I need to dynamically rerender a treeview to display the next set of nodes depending on which page we're on. For example, page 1 will dispaly only nodes 1 to 10, but when the user clicks , the tree will display nodes 11 to 20. Page 1 will is loaded when the page that contains the ascx (parent of the treeview) is loaded. This is all cool. The treeview displays correctly. When I click the ...
3
21850
by: Michael_Burgess | last post by:
Hi there, I've looked around the different groups and still can't figure this out without resorting to scrappy code............ I want to programtically select and highlight a TreeView node, such that it looks the same as if a user has clicked it. I'm aware about the SelectedNode property, but this just seems to expand the TreeView to show the node in question, but not highlight
1
1492
by: Rick | last post by:
Hi guys! I have a problem with a master page that has a treeview control as menu, i have a root node, 5 parents and each parent has 10 leafs, 50 pages in total, each page is linked to master page, when i select a node in treeview it redirects to N page, its ok, but i want each time i select a page in the treeview it expand the tree to current node selected, i can't do it, each time i select a node, treeview appears as originally i...
4
7445
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
5
2766
by: =?Utf-8?B?dmlubw==?= | last post by:
Hello I have created a TreeView and i wish to select a node into it and then expand the selected node. Is someone has an idea ? Thanks
0
8236
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8173
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8679
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8621
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8335
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6110
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4079
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2606
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 we have to send another system
2
1482
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.