Binding DataGrid to an Array

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alan Gillott

    Binding DataGrid to an Array

    Is it possible to bind a Datagrid to a 2 dimentional Array? Or even a
    Collection? I know Linq can in vb2008 but I don't want to download 2008 just
    yet.
    Lots of examples binding text boxes to Id arrays or DataGrids to Databases
    but I can't quite get my head around what to do for datagrid to Array.
    A

  • Alan Gillott

    #2
    Re: Binding DataGrid to an Array


    "Alan Gillott" <argillott.x@gm ail.comwrote in message
    news:F67CE4B7-D6D0-4BEF-8C4E-C26C790C4D9A@mi crosoft.com...
    Is it possible to bind a Datagrid to a 2 dimentional Array? Or even a
    Collection? I know Linq can in vb2008 but I don't want to download 2008
    just yet.
    Lots of examples binding text boxes to Id arrays or DataGrids to Databases
    but I can't quite get my head around what to do for datagrid to Array.
    A

    Comment

    • Bob Powell [MVP]

      #3
      Re: Binding DataGrid to an Array

      You can bind to a collection of simple values in which case you get a single
      column of editable data.

      You can bind to a collection of objects in which case the grid will try to
      define columns based on the names of the properties in the objects and use
      them for column names.

      You cannot bind to a two dimentional array of, say, integers.

      --
      --
      Bob Powell [MVP]
      Visual C#, System.Drawing

      Ramuseco Limited .NET consulting


      Find great Windows Forms articles in Windows Forms Tips and Tricks


      Answer those GDI+ questions with the GDI+ FAQ


      All new articles provide code in C# and VB.NET.
      Subscribe to the RSS feeds provided and never miss a new article.


      "Alan Gillott" <argillott.x@gm ail.comwrote in message
      news:4234FAF8-BE1C-4A3E-B452-45ADF6E63C89@mi crosoft.com...
      >
      "Alan Gillott" <argillott.x@gm ail.comwrote in message
      news:F67CE4B7-D6D0-4BEF-8C4E-C26C790C4D9A@mi crosoft.com...
      >Is it possible to bind a Datagrid to a 2 dimentional Array? Or even a
      >Collection? I know Linq can in vb2008 but I don't want to download 2008
      >just yet.
      >Lots of examples binding text boxes to Id arrays or DataGrids to
      >Databases but I can't quite get my head around what to do for datagrid to
      >Array.
      >A
      >

      Comment

      • Bob Powell [MVP]

        #4
        Re: Binding DataGrid to an Array

        Sorry, the first statement was incorrect.

        --
        --
        Bob Powell [MVP]
        Visual C#, System.Drawing

        Ramuseco Limited .NET consulting


        Find great Windows Forms articles in Windows Forms Tips and Tricks


        Answer those GDI+ questions with the GDI+ FAQ


        All new articles provide code in C# and VB.NET.
        Subscribe to the RSS feeds provided and never miss a new article.


        "Bob Powell [MVP]" <bob@spamkiller bobpowell.netwr ote in message
        news:%23FFxG09e IHA.1824@TK2MSF TNGP02.phx.gbl. ..
        You can bind to a collection of simple values in which case you get a
        single
        column of editable data.
        >
        You can bind to a collection of objects in which case the grid will try to
        define columns based on the names of the properties in the objects and use
        them for column names.
        >
        You cannot bind to a two dimentional array of, say, integers.
        >
        --
        --
        Bob Powell [MVP]
        Visual C#, System.Drawing
        >
        Ramuseco Limited .NET consulting

        >
        Find great Windows Forms articles in Windows Forms Tips and Tricks

        >
        Answer those GDI+ questions with the GDI+ FAQ

        >
        All new articles provide code in C# and VB.NET.
        Subscribe to the RSS feeds provided and never miss a new article.
        >
        >
        "Alan Gillott" <argillott.x@gm ail.comwrote in message
        news:4234FAF8-BE1C-4A3E-B452-45ADF6E63C89@mi crosoft.com...
        >>
        >"Alan Gillott" <argillott.x@gm ail.comwrote in message
        >news:F67CE4B 7-D6D0-4BEF-8C4E-C26C790C4D9A@mi crosoft.com...
        >>Is it possible to bind a Datagrid to a 2 dimentional Array? Or even a
        >>Collection? I know Linq can in vb2008 but I don't want to download 2008
        >>just yet.
        >>Lots of examples binding text boxes to Id arrays or DataGrids to
        >>Databases but I can't quite get my head around what to do for datagrid
        >>to
        >>Array.
        >>A
        >>
        >

        Comment

        • Marc Gravell

          #5
          Re: Binding DataGrid to an Array

          Sorry to reopen an oldie, but I only just saw it; anyway - yes, you can ;-p


          Comment

          Working...