I have a page which has a tree directory of people who work at this company. Initially the only way to open the nodes was to click on the little +/- but when you get to the last level, the person's name was there and clickable off to their bio page. I have since fixed it to where the text will also expand the node, but now the name is not clickable anymore. It still has the "link" look (blue, underlined, changes red when hovered over) but the icon stays as the same and does not turn to the finger. Thank you in advance!
Here is the code on the page...
<%@ Control language="C#" Inherits="Modules.PeopleNav.PeopleByAlpha" CodeFile="PeopleByAlpha.ascx.cs" AutoEventWireup="true"%>
<%@ Register TagPrefix="dnn" TagName="Audit" Src="~/controls/ModuleAuditControl.ascx" %>
<asp:TreeView ID="TreeView1" runat="server" DataSourceID="XmlDataSource1"
ExpandDepth="1" onselectednodechanged="TreeView1_SelectedNodeChanged" OnTreeNodeDataBound="TreeView1_TreeNodeDataBound">
<DataBindings>
<asp:TreeNodeBinding DataMember="Person" ValueField="Value" TextField="Name">
</asp:TreeNodeBinding>
<asp:TreeNodeBinding DataMember="AlphaBreak" TextField="Name">
</asp:TreeNodeBinding>
<asp:TreeNodeBinding DataMember="PeopleAlpha" TextField="Name">
</asp:TreeNodeBinding>
</DataBindings>
</asp:TreeView><br />
<asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/Portals/0/Docs/PeopleAlpha.xml"></asp:XmlDataSource>
And the code behind...
protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
{
String sURL = TreeView1.SelectedNode.Value.ToString();
if (sURL.Length > 5)
{
String sExt = sURL.Substring(sURL.Length - 4, 4);
if (sExt == "aspx")
{
Response.Redirect(sURL);
}
}
}
protected void TreeView1_TreeNodeDataBound(object sender, TreeNodeEventArgs e)
{
e.Node.SelectAction = TreeNodeSelectAction.Expand;
}