473,385 Members | 1,798 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.

asp.net 2.0 treeview control expand with select

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 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 2406
Hi Stephen,

you can use TreeView1.ExpandAll() 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
"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 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="SiteMapDataSource1"
ForeColor="Black" ExpandDepth="0"
BorderStyle="None" BackColor="Transparent"
Font-Names="Tahoma;verdana;arial"
NodeIndent="15" AutoGenerateDataBindings="False">
<LeafNodeStyle ForeColor="Black"></LeafNodeStyle>
<HoverNodeStyle Font-Bold="False" ForeColor="#6666AA"
Font-Underline="True"></HoverNodeStyle>
<SelectedNodeStyle Font-Underline="False"
HorizontalPadding="0px"
VerticalPadding="0px" />
<NodeStyle Font-Names="Tahoma" Font-Size="8pt"
ForeColor="Black" HorizontalPadding="2px"
NodeSpacing="0px" VerticalPadding="2px" />
<ParentNodeStyle ForeColor="Blue" />
<RootNodeStyle ForeColor="Blue" />
<DataBindings>
<asp:TreeNodeBinding DataMember="SiteMapNode"
NavigateUrlField="Url" SelectAction="Expand" TextField="Title" />
</DataBindings>
</asp:TreeView>

Works perfectly...

Stephen wrote:
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 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
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...
1
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...
2
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...
8
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...
1
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...
3
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,...
1
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...
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
5
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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.