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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Binding Collection to Datagrid

Binding Collection to Datagrid

Scheduled Pinned Locked Moved C#
wpfwcfsysadminquestion
3 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.
  • T Offline
    T Offline
    thematt
    wrote on last edited by
    #1

    :)I have an arraylist (arrList) that has contains objects (obj). I would like to bind arrList to a datagrid with each column of the datagrid shows a member of the obj. Anyone know a 'good' way to do this aside from iterating through arrList and creating a dataset to bind to the datagrid? Matt is a network administrator for an auditing company in the midwest.

    L 1 Reply Last reply
    0
    • T thematt

      :)I have an arraylist (arrList) that has contains objects (obj). I would like to bind arrList to a datagrid with each column of the datagrid shows a member of the obj. Anyone know a 'good' way to do this aside from iterating through arrList and creating a dataset to bind to the datagrid? Matt is a network administrator for an auditing company in the midwest.

      L Offline
      L Offline
      leppie
      wrote on last edited by
      #2

      Setting your datagrid's DataSource to the arraylist should do the trick...as far I understood it. You might have to make a strongly typed collection though and implement IEnumerator. I suggest downloading this http://kristopherjohnson.net/kj/TypedCollectionGenerator[^] to autocreate the derived class. Hope it helps :) "I dont have a life, I have a program." Also, I won't support any software without the LeppieRules variable.

      T 1 Reply Last reply
      0
      • L leppie

        Setting your datagrid's DataSource to the arraylist should do the trick...as far I understood it. You might have to make a strongly typed collection though and implement IEnumerator. I suggest downloading this http://kristopherjohnson.net/kj/TypedCollectionGenerator[^] to autocreate the derived class. Hope it helps :) "I dont have a life, I have a program." Also, I won't support any software without the LeppieRules variable.

        T Offline
        T Offline
        thematt
        wrote on last edited by
        #3

        Thanks for the tip.:) Matt is a network administrator for an auditing company in the midwest.

        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