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