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. General Programming
  3. C#
  4. Load XML data into treeview [modified]

Load XML data into treeview [modified]

Scheduled Pinned Locked Moved C#
questionxmljsonhelp
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.
  • G Offline
    G Offline
    GermanDM
    wrote on last edited by
    #1

    Hi, Ok i have my XML file a generate in my application which holds account information. How can i populate only the "AccountName" field in a treeview? i tried and am struggling it doesnt populate correct. Im using VS2005 and this is a windows application. my xml file looks like this: 1 gmail me 1234 njun 3 codeproject me2 1234555 hhhhhhhh 8 myacc1 qwe 111 fgfg I only want the "AccountName" field to show in the treeview so when they click on it the rest of the data shows in labels. I have done this with a listbox but would like to use a treeview thanks alot guys hope you can help Regards

    B 1 Reply Last reply
    0
    • G GermanDM

      Hi, Ok i have my XML file a generate in my application which holds account information. How can i populate only the "AccountName" field in a treeview? i tried and am struggling it doesnt populate correct. Im using VS2005 and this is a windows application. my xml file looks like this: 1 gmail me 1234 njun 3 codeproject me2 1234555 hhhhhhhh 8 myacc1 qwe 111 fgfg I only want the "AccountName" field to show in the treeview so when they click on it the rest of the data shows in labels. I have done this with a listbox but would like to use a treeview thanks alot guys hope you can help Regards

      B Offline
      B Offline
      beatles1692
      wrote on last edited by
      #2

      Hi You can use xpath to query a specific node within a xml file. Open a xml file in a XmlDocument object (System.Xml namespace) and then you can get its elements using xpath.XmlDocument has some methods that you can use to query a xml file for example you can use SelectNodes or SelectSingleNode or GetElementsByTagName. You can use serialization to serialize and deserialize your xml file into an object model.You can use xsd utility to build this object model from your xml file the you can use XmlSerializer (System.Xml.Serialization namespace) to deserialize your xml file into your object model and use this object model to populate a treeview. Regards Nima

      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