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?