Tree view control
-
Hi, I am using a Treeview control with xml file as source file. I have given the html source code below. <asp:TreeView ID="TreeLeftNavigation" runat="server" DataSourceID="XmlDataSource1" ImageSet="Simple" OnTreeNodePopulate="TreeLeftNavigation_TreeNodePopulate" > <DataBindings> <asp:TreeNodeBinding DataMember="Countries" Text="Countries" Value="Countries" /> <asp:TreeNodeBinding DataMember="continent" TextField="cont" /> <asp:TreeNodeBinding DataMember="country" TextField="coun" /> <asp:TreeNodeBinding DataMember="language" TextField="lang" NavigateUrlField="Url"/> <asp:TreeNodeBinding DataMember="captial" TextField="cap" /> <asp:TreeNodeBinding DataMember="cities" TextField="city" /> </DataBindings> <ParentNodeStyle Font-Bold="False" /> <HoverNodeStyle Font-Underline="True" ForeColor="#5555DD" /> <SelectedNodeStyle Font-Underline="True" ForeColor="#5555DD" HorizontalPadding="0px" VerticalPadding="0px" /> <NodeStyle Font-Names="Tahoma" Font-Size="10pt" ForeColor="Black" HorizontalPadding="0px" NodeSpacing="0px" VerticalPadding="0px" /> </asp:TreeView> <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/XMLFile.xml"></asp:XmlDataSource> This is my xml file content. <?xml version="1.0" encoding="utf-8" ?> <Countries> <continent cont="NorthAmerica"> <country coun="United States of America"> <language lang="English" Url="Header.aspx"></language> <capital cap="Washington D.C"></capital> <cities city="Chicago"></cities> </country> </continent> <continent cont="Europe"> <country coun="United Kingdom"> <language lang=" English" Url="Header.aspx"></language> <capital cap="London"></capital> <cities city="Bristol"></cities> </country> </continent> </Countries> Here i have given the url link in xml file. I am getting the url v
-
Hi, I am using a Treeview control with xml file as source file. I have given the html source code below. <asp:TreeView ID="TreeLeftNavigation" runat="server" DataSourceID="XmlDataSource1" ImageSet="Simple" OnTreeNodePopulate="TreeLeftNavigation_TreeNodePopulate" > <DataBindings> <asp:TreeNodeBinding DataMember="Countries" Text="Countries" Value="Countries" /> <asp:TreeNodeBinding DataMember="continent" TextField="cont" /> <asp:TreeNodeBinding DataMember="country" TextField="coun" /> <asp:TreeNodeBinding DataMember="language" TextField="lang" NavigateUrlField="Url"/> <asp:TreeNodeBinding DataMember="captial" TextField="cap" /> <asp:TreeNodeBinding DataMember="cities" TextField="city" /> </DataBindings> <ParentNodeStyle Font-Bold="False" /> <HoverNodeStyle Font-Underline="True" ForeColor="#5555DD" /> <SelectedNodeStyle Font-Underline="True" ForeColor="#5555DD" HorizontalPadding="0px" VerticalPadding="0px" /> <NodeStyle Font-Names="Tahoma" Font-Size="10pt" ForeColor="Black" HorizontalPadding="0px" NodeSpacing="0px" VerticalPadding="0px" /> </asp:TreeView> <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/XMLFile.xml"></asp:XmlDataSource> This is my xml file content. <?xml version="1.0" encoding="utf-8" ?> <Countries> <continent cont="NorthAmerica"> <country coun="United States of America"> <language lang="English" Url="Header.aspx"></language> <capital cap="Washington D.C"></capital> <cities city="Chicago"></cities> </country> </continent> <continent cont="Europe"> <country coun="United Kingdom"> <language lang=" English" Url="Header.aspx"></language> <capital cap="London"></capital> <cities city="Bristol"></cities> </country> </continent> </Countries> Here i have given the url link in xml file. I am getting the url v
try this for your solutions I hope it works for u. protected void Node_Populate(object sender, System.Web.UI.WebControls.TreeNodeEventArgs e) { if (e.Node.ChildNodes.Count == 0) { switch (e.Node.Depth) { case 0: function(e.Node); //here u can get the node value break; } } }
Vijay V. Yash Softech