Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Tree View Control

Tree View Control

Scheduled Pinned Locked Moved ASP.NET
helphtmlwpfwcfsysadmin
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    anandhakrishnan
    wrote on last edited by
    #1

    Hi, I am using Tree view control for navigation. I am using XmlDataSource control as the datasource for the tree view control. I have given below the Xml file content. <?xml version="1.0" encoding="utf-8" ?> <Countries> <continent cont="NorthAmerica" Navigate="Header.aspx"> <country coun="United States of America"> <language lang="English"></language> <capital cap="Washington D.C"></capital> <cities city="Chicago"></cities> </country> </continent> <continent cont="Europe"> <country coun="United Kingdom"> <language lang=" English"></language> <capital cap="London"></capital> <cities city="Bristol"></cities> </country> </continent> </Countries> Html source: <asp:TreeView ID="LeftNavigation" runat="server" DataSourceID="XmlDataSource1"> <DataBindings> <asp:TreeNodeBinding DataMember="Countries" Text="Countries" NavigateUrlField="Navigate" /> <asp:TreeNodeBinding DataMember="continent" TextField="cont"/> <asp:TreeNodeBinding DataMember="country" TextField="coun" /> <asp:TreeNodeBinding DataMember="language" TextField="lang" /> <asp:TreeNodeBinding DataMember="captial" TextField="cap" /> <asp:TreeNodeBinding DataMember="cities" TextField="city" /> </DataBindings> </asp:TreeView> <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/XMLFile.xml"></asp:XmlDataSource> Here the binding working fine. But the navigation is not working. I have given the NavigateUrlField="Navigate". "Navigate" is having the url in xml file. Giving the binding error @ runtime. Pls help me! Tnx.

    S 1 Reply Last reply
    0
    • A anandhakrishnan

      Hi, I am using Tree view control for navigation. I am using XmlDataSource control as the datasource for the tree view control. I have given below the Xml file content. <?xml version="1.0" encoding="utf-8" ?> <Countries> <continent cont="NorthAmerica" Navigate="Header.aspx"> <country coun="United States of America"> <language lang="English"></language> <capital cap="Washington D.C"></capital> <cities city="Chicago"></cities> </country> </continent> <continent cont="Europe"> <country coun="United Kingdom"> <language lang=" English"></language> <capital cap="London"></capital> <cities city="Bristol"></cities> </country> </continent> </Countries> Html source: <asp:TreeView ID="LeftNavigation" runat="server" DataSourceID="XmlDataSource1"> <DataBindings> <asp:TreeNodeBinding DataMember="Countries" Text="Countries" NavigateUrlField="Navigate" /> <asp:TreeNodeBinding DataMember="continent" TextField="cont"/> <asp:TreeNodeBinding DataMember="country" TextField="coun" /> <asp:TreeNodeBinding DataMember="language" TextField="lang" /> <asp:TreeNodeBinding DataMember="captial" TextField="cap" /> <asp:TreeNodeBinding DataMember="cities" TextField="city" /> </DataBindings> </asp:TreeView> <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/XMLFile.xml"></asp:XmlDataSource> Here the binding working fine. But the navigation is not working. I have given the NavigateUrlField="Navigate". "Navigate" is having the url in xml file. Giving the binding error @ runtime. Pls help me! Tnx.

      S Offline
      S Offline
      sarang_k
      wrote on last edited by
      #2

      chk with Navigateurl property there is anoter property "target." set that property and try.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups