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. using datarow array as data source

using datarow array as data source

Scheduled Pinned Locked Moved C#
csharpdata-structureshelptutorial
5 Posts 3 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.
  • P Offline
    P Offline
    Prashant Gadhave
    wrote on last edited by
    #1

    In my windows application (C#) I need to use a datarow array as datasource for datagrid ,but I don't know how to bind it .Any help please.. Thank you.

    L 1 Reply Last reply
    0
    • P Prashant Gadhave

      In my windows application (C#) I need to use a datarow array as datasource for datagrid ,but I don't know how to bind it .Any help please.. Thank you.

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      dataGrid1.DataSource = new ArrayList( dataRowArray);

      "What classes are you using ? You shouldn't call stuff if you have no idea what it does"
      Christian Graus in the C# forum

      led mike

      P 1 Reply Last reply
      0
      • L led mike

        dataGrid1.DataSource = new ArrayList( dataRowArray);

        "What classes are you using ? You shouldn't call stuff if you have no idea what it does"
        Christian Graus in the C# forum

        led mike

        P Offline
        P Offline
        Prashant Gadhave
        wrote on last edited by
        #3

        I have used a dataset and fired a query on it using select method which returns datarow array.This array I want to bind to datagrid. I tried your solution ,But what I saw in the datagrid was RowError,RowState,ItemArray,HasErrors,Table as columns which are not the columns in dataset. Any help on this?

        L U 2 Replies Last reply
        0
        • P Prashant Gadhave

          I have used a dataset and fired a query on it using select method which returns datarow array.This array I want to bind to datagrid. I tried your solution ,But what I saw in the datagrid was RowError,RowState,ItemArray,HasErrors,Table as columns which are not the columns in dataset. Any help on this?

          L Offline
          L Offline
          led mike
          wrote on last edited by
          #4

          Prashant Gadhave wrote:

          I have used a dataset and fired a query on it using select method which returns datarow array

          For filtering rows of a DataTable you should use System.Data.DataView and set that as the DataGrid.DataSource.

          "What classes are you using ? You shouldn't call stuff if you have no idea what it does"
          Christian Graus in the C# forum

          led mike

          1 Reply Last reply
          0
          • P Prashant Gadhave

            I have used a dataset and fired a query on it using select method which returns datarow array.This array I want to bind to datagrid. I tried your solution ,But what I saw in the datagrid was RowError,RowState,ItemArray,HasErrors,Table as columns which are not the columns in dataset. Any help on this?

            U Offline
            U Offline
            User 4448507
            wrote on last edited by
            #5

            Hi I understand u r problem and has a solution Use DATAVIEW DataView Dv = new DataView(DataTable); Dv.RowFilter = ""//Write the query and then assign datagrid.datasource=DV

            vivek vitthalrao hedau

            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