Hey men. I am getting an problem with utilizing a datagridview for any user entering data that's saved to some database. Essentially, Among the finest these to throw stuff right into a row after which my code will place the information. I understand there needs to be some event for which I am attempting to and that i cannot decipher it.

I attempted the LeavingRow event, the main problem with that's the final value has not up-to-date if this event triggers. I mean ,, say there exists a row with four posts, and also the user has joined data in to the first three posts. They enter info within the last column, then push lower to go in a brand new row. The place fails, since it thinks the final column continues to be empty.

I additionally attempted UserAddsRow, but had that fail since it triggers the moment the consumer begins typing to include a row, so there'd be merely a single character within the first column from the row I had been attempting to add.

Does anybody have recommendations for getting these, as well as other event employed by my reasons?

The 2 inelegant options I am weighing really are a) stringing together some labels/textboxes as well as an add button or b) while using DataGridCell_ValueChanged event, by getting some nested try/catch which will attempt to place first, then whether it fails attempt to update, after which do nothing at all when the update does not work. It's grossly inefficient, but It would complete the job since there's only likely to be a few dozen rows tops previously within this datagridview.

Appreciate your time and effort.

I typically make use of the RowValidated Event. I personally use the wedding since it enables for any whole row to become joined / edited prior to trying in order to save the alterations.

When handling the big event I recieve the rows which have been added, up-to-date or erased in the dataset (DataSet.GetChanges) after which carry out the appropriate actions per type (Add, Update, Remove).