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. datagrid problem

datagrid problem

Scheduled Pinned Locked Moved C#
helpdatabasequestion
2 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.
  • M Offline
    M Offline
    mdolby
    wrote on last edited by
    #1

    I'm using a datagrid to display information from a dataset. I added a "delete button" and wish to delete the selected cell in the datagrid. But I have the following problems.. 1.- If I rearrange the rows by clicking on the column header of the datagrid, I can no longer find the correct row corresponding to the database using the currentcell.row #.. the currentcell.row would say something like it's row #3 which does not correspond to row #3 in the dataset since I rearranged the rows in the datagrid. 2.- I cannot either manually look for the corresponding row in the database using the currentcell info, because when I displayed the information on the datagrid I ommited the primary key.. So I cannot retrieve this primary key from the currentcell.. Does anyone know of a workaround or a way to actually save the dataset row object with each row of the datagrid?? As always I thank you for any help!!

    A 1 Reply Last reply
    0
    • M mdolby

      I'm using a datagrid to display information from a dataset. I added a "delete button" and wish to delete the selected cell in the datagrid. But I have the following problems.. 1.- If I rearrange the rows by clicking on the column header of the datagrid, I can no longer find the correct row corresponding to the database using the currentcell.row #.. the currentcell.row would say something like it's row #3 which does not correspond to row #3 in the dataset since I rearranged the rows in the datagrid. 2.- I cannot either manually look for the corresponding row in the database using the currentcell info, because when I displayed the information on the datagrid I ommited the primary key.. So I cannot retrieve this primary key from the currentcell.. Does anyone know of a workaround or a way to actually save the dataset row object with each row of the datagrid?? As always I thank you for any help!!

      A Offline
      A Offline
      A Wegierski
      wrote on last edited by
      #2

      Current row in DataGrid (from WinForm) is a row number from DataView, not from DataTable. You can get DataView object from DataGrid object protected(!) property: (DataView)(myDataGrid.ListManager.List) Hi, AW

      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