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. LINQ
  4. Programatically binding dynamically generated Linq To Xml structure to GridView

Programatically binding dynamically generated Linq To Xml structure to GridView

Scheduled Pinned Locked Moved LINQ
csharpwpfwcflinqcom
2 Posts 2 Posters 7 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.
  • E Offline
    E Offline
    Esulin2
    wrote on last edited by
    #1

    I have an XDocument that I dynamically create from an external set of data. I would like to programatically bind the content of the whole document to a databound control such as a GridView. The caveat is that the XML structure will differ from one use to the next, so I cannot explicitly specify the structure of the resulting IEnumerable object. I need the structure to be implicitly generated based on the structure of the XML. At the moment the only way I've found of doing this is to import the XML into a DataSet and then bind that, but that somewhat misses the point. The XML can look something like this: bobsmith@acme.com List Type 1 Mr. Bob Smith Administration Manager Acme Inc bobsmith@acme.com List Type 2 Mr. Bob Smith Administration Manager Acme Inc bobsmith@acme.com List Type 3 Mr. Bob Smith Administration Manager Acme Inc

    modified on Friday, June 6, 2008 4:39 AM

    J 1 Reply Last reply
    0
    • E Esulin2

      I have an XDocument that I dynamically create from an external set of data. I would like to programatically bind the content of the whole document to a databound control such as a GridView. The caveat is that the XML structure will differ from one use to the next, so I cannot explicitly specify the structure of the resulting IEnumerable object. I need the structure to be implicitly generated based on the structure of the XML. At the moment the only way I've found of doing this is to import the XML into a DataSet and then bind that, but that somewhat misses the point. The XML can look something like this: bobsmith@acme.com List Type 1 Mr. Bob Smith Administration Manager Acme Inc bobsmith@acme.com List Type 2 Mr. Bob Smith Administration Manager Acme Inc bobsmith@acme.com List Type 3 Mr. Bob Smith Administration Manager Acme Inc

      modified on Friday, June 6, 2008 4:39 AM

      J Offline
      J Offline
      Judah Gabriel Himango
      wrote on last edited by
      #2

      Regarding binding to the content of the document, did you see the Bindable LINQ post right below this? I'm not sure if that works given your inability to "specify the structure of the enumerable". (Not quite sure what you mean by that, though, maybe you can clarify.)

      Life, family, faith: Give me a visit. From my latest post: "How differently the psalmist saw it! How blessed -- how truly happy with real joy! -- is the man who delights in the Law of the Lord." Judah Himango

      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