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. WPF
  4. viewing xml data in wpf [modified]

viewing xml data in wpf [modified]

Scheduled Pinned Locked Moved WPF
csharpquestionphpwpfxml
6 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.
  • S Offline
    S Offline
    Sonar87
    wrote on last edited by
    #1

    I just want to get the text in elements like the id, name, and lastactive from an xml file like this ( http://www.dreamincode.net/forums/xml.php?showuser=34 ) into a textbox or anything that would just display in a simple way, but I haven't been able to find anything that explains that level of it. How can I do this? -- Modified Sunday, August 22, 2010 3:07 AM

    P 1 Reply Last reply
    0
    • S Sonar87

      I just want to get the text in elements like the id, name, and lastactive from an xml file like this ( http://www.dreamincode.net/forums/xml.php?showuser=34 ) into a textbox or anything that would just display in a simple way, but I haven't been able to find anything that explains that level of it. How can I do this? -- Modified Sunday, August 22, 2010 3:07 AM

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      I demonstrate how to bind to XML data in this[^] article. All you need to do is replace the XmlDataProvider with a link to your data.

      "WPF has many lovers. It's a veritable porn star!" - Josh Smith

      As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

      My blog | My articles | MoXAML PowerToys | Onyx

      S 1 Reply Last reply
      0
      • P Pete OHanlon

        I demonstrate how to bind to XML data in this[^] article. All you need to do is replace the XmlDataProvider with a link to your data.

        "WPF has many lovers. It's a veritable porn star!" - Josh Smith

        As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

        My blog | My articles | MoXAML PowerToys | Onyx

        S Offline
        S Offline
        Sonar87
        wrote on last edited by
        #3

        Never mind, figured it out. Thank you very much, your article and method was the first -after hours trying to get this to work- that made much sense to me. -- Modified Sunday, August 22, 2010 5:39 AM

        P 1 Reply Last reply
        0
        • S Sonar87

          Never mind, figured it out. Thank you very much, your article and method was the first -after hours trying to get this to work- that made much sense to me. -- Modified Sunday, August 22, 2010 5:39 AM

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          Sonar87 wrote:

          figured it ou

          Excellent.:thumbsup:

          "WPF has many lovers. It's a veritable porn star!" - Josh Smith

          As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

          My blog | My articles | MoXAML PowerToys | Onyx

          S 1 Reply Last reply
          0
          • P Pete OHanlon

            Sonar87 wrote:

            figured it ou

            Excellent.:thumbsup:

            "WPF has many lovers. It's a veritable porn star!" - Josh Smith

            As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

            My blog | My articles | MoXAML PowerToys | Onyx

            S Offline
            S Offline
            Sonar87
            wrote on last edited by
            #5

            Is there any way I can get the resource/xml file I'm reading from to be changed, say, based on user input when the program is running, or does it have to stay a set path that I decide ahead of time? I tried accessing some of the info back in the Window1.xaml.cs file to to see if I could make changes there but if theres a way its nothing I've thought of.

            P 1 Reply Last reply
            0
            • S Sonar87

              Is there any way I can get the resource/xml file I'm reading from to be changed, say, based on user input when the program is running, or does it have to stay a set path that I decide ahead of time? I tried accessing some of the info back in the Window1.xaml.cs file to to see if I could make changes there but if theres a way its nothing I've thought of.

              P Offline
              P Offline
              Pete OHanlon
              wrote on last edited by
              #6

              You can change it just by changing the DataContext. As long as you've implemented your binding, your UI elements should change when the context does.

              "WPF has many lovers. It's a veritable porn star!" - Josh Smith

              As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

              My blog | My articles | MoXAML PowerToys | Onyx

              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