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. Read a row from dataGrid

Read a row from dataGrid

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

    I hope I can find an idea here. I have a dataGrid that displays data from a DataSet. It seems to be working well. I have attached a context menu to it. What I am trying to do now is to read the selected row of this dataGrid. The farest I can go is getting the CurrentRowIndex of selected row. Is there a way to read something from the dataGrid at all? I can't find one method in that class that will do that for me. I am sorry if the question is stupid and there is a simple solution I passed by in the documentation. thanks a lot. Alexander.

    M K 2 Replies Last reply
    0
    • D dophka

      I hope I can find an idea here. I have a dataGrid that displays data from a DataSet. It seems to be working well. I have attached a context menu to it. What I am trying to do now is to read the selected row of this dataGrid. The farest I can go is getting the CurrentRowIndex of selected row. Is there a way to read something from the dataGrid at all? I can't find one method in that class that will do that for me. I am sorry if the question is stupid and there is a simple solution I passed by in the documentation. thanks a lot. Alexander.

      M Offline
      M Offline
      Mazdak
      wrote on last edited by
      #2

      datagrid[datagrid.CurrentCell.RowIndex,columnnumber] Mazy No sig. available now.

      1 Reply Last reply
      0
      • D dophka

        I hope I can find an idea here. I have a dataGrid that displays data from a DataSet. It seems to be working well. I have attached a context menu to it. What I am trying to do now is to read the selected row of this dataGrid. The farest I can go is getting the CurrentRowIndex of selected row. Is there a way to read something from the dataGrid at all? I can't find one method in that class that will do that for me. I am sorry if the question is stupid and there is a simple solution I passed by in the documentation. thanks a lot. Alexander.

        K Offline
        K Offline
        KevinMac
        wrote on last edited by
        #3

        I am not sure if this is what you are looking for but you can use the DataGrid.CurrentCell to get the row and column which you can use to read the dataset.

        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