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. Add Record to Data Table

Add Record to Data Table

Scheduled Pinned Locked Moved C#
databasealgorithmshelpquestion
1 Posts 1 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
    polishprogrammer
    wrote on last edited by
    #1

    I have an database editing application. The tables in this application are sorted by ID (an autonumber field), so they are basically in FIFO order. However, the editing part of the application consists of a DataGridView object to enable the user to view all the records in the table and some text boxes and comboboxes below the DataGridView to see the details of each individual record in the table. The user edits or adds records through the text boxes and comboboxes that reflect the fields in the datatable, while the DataGridView is just for viewing (set to Edit Programmatically). The user, though, can sort records using the DataGridView to help him/her find records in the table by the order of some field other than the ID. Well, when I add records to the table when the table is sorted according to, say, a serial number, I'm experiencing some problems. The record is added, but does not occupy the final position in the data table. Rather, it occupies the first position in the table because a new record consists of a blank serial number. Is there a way to keep from sorting the new record into the first position in the datatable? I would prefer to keep it as the last record in the table, and then sort it into its appropriate position. Thanks.

    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