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. .NET (Core and Framework)
  4. Datagridview sorting and Database.

Datagridview sorting and Database.

Scheduled Pinned Locked Moved .NET (Core and Framework)
databasealgorithmsquestion
4 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.
  • J Offline
    J Offline
    Johnkokk
    wrote on last edited by
    #1

    I have a datagridview which is bound to a ms access database, through a dataset. The user can click one record on the DGV, and open another window with all the data of the record, so that he can edit them,etc. If he tries to sort the DGV by a column, let's say the date field and then tries to load a record the thing gets messed up. It seems that whilst the DGV is sorted, the dataset is not equally "sorted". That means that the user can try to load a specific record but instead he gets a completely different one. Is there a solution to that ?

    A 1 Reply Last reply
    0
    • J Johnkokk

      I have a datagridview which is bound to a ms access database, through a dataset. The user can click one record on the DGV, and open another window with all the data of the record, so that he can edit them,etc. If he tries to sort the DGV by a column, let's say the date field and then tries to load a record the thing gets messed up. It seems that whilst the DGV is sorted, the dataset is not equally "sorted". That means that the user can try to load a specific record but instead he gets a completely different one. Is there a solution to that ?

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

      You need to either use a unique key to load the record into the new window, or sort your underlying dataset in the same way as the DGV when the column header is clicked.

      Bob Ashfield Consultants Ltd

      J 1 Reply Last reply
      0
      • A Ashfield

        You need to either use a unique key to load the record into the new window, or sort your underlying dataset in the same way as the DGV when the column header is clicked.

        Bob Ashfield Consultants Ltd

        J Offline
        J Offline
        Johnkokk
        wrote on last edited by
        #3

        You need to either use a unique key to load the record into the new window, or sort your underlying dataset in the same way as the DGV when the column header is clicked. There is already an ID field which is unique. How do i sort the dataset ? That's the question in the first place. :)

        J 1 Reply Last reply
        0
        • J Johnkokk

          You need to either use a unique key to load the record into the new window, or sort your underlying dataset in the same way as the DGV when the column header is clicked. There is already an ID field which is unique. How do i sort the dataset ? That's the question in the first place. :)

          J Offline
          J Offline
          Johnkokk
          wrote on last edited by
          #4

          Anyone guys ? Any ideas ?

          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