0

I'm having an issue with using a datagridview for a user entering data that's saved to a database. Basically, I just want them to throw stuff into a row and then my code will insert the data.

I tried LeavingRow event, but the problem with this is,enter the values in default row that is already added in datagridview, these value hasn't updated when this event triggers.

I also tried UserAddsRow, but had that fail because it triggers as soon as the user starts typing to add a row.

user2194838
  • 337
  • 2
  • 8
  • 24

1 Answers1

0

In Row leave event Use the following code before savig. Then try to save. While saving also you see the index of the row which your code is pointing.

 yourgrid.CommitEdit(DataGridViewDataErrorContexts.Commit);

This code may help you..

Raghuveera
  • 320
  • 3
  • 9
  • 27