Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > asp.net 2.0 treeview control expand with select

Reply
Thread Tools

asp.net 2.0 treeview control expand with select

 
 
Stephen
Guest
Posts: n/a
 
      08-03-2005
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?

 
Reply With Quote
 
 
 
 
=?Utf-8?B?d2hpZGJleV9ib3k=?=
Guest
Posts: n/a
 
      08-19-2005
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?
>
>

 
Reply With Quote
 
 
 
 
Stephen
Guest
Posts: n/a
 
      08-24-2005
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?


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to put Expand all and Collapse all button for a asp.net TreeView Control ? vivek ASP .Net 2 06-14-2007 05:24 AM
Treeview Control Expand Collapse Reeya ASP .Net Web Controls 2 01-31-2005 11:41 PM
treeview control not expand until reload nextman ASP .Net Web Controls 2 04-28-2004 08:28 AM
Expand treeView web control using client script Dgorf ASP .Net Web Controls 1 01-12-2004 04:08 AM
urgent please : treeview control expand collapse Gönen EREN ASP .Net 4 08-16-2003 06:15 PM



Advertisments