I have a datagridview where the default values are provided for every new row being inserted. Sometimes defaults are 100% suitable for the new row and the record should be saved with no more changes. But if user simple leaves the row the record clears 🙁 How can i auto-save the new row (or auto-set edit mode for it) to let user insert a new one?
Thanks!
I have a datagridview where the default values are provided for every new row
Share
As I understand it, you want to sometimes save a new record with the default cell values generated when the users adds a new row. You could intercept the lost focus event of the datagridview to check if there is such a new “default” row and store it on the database. But this method would always create a new row on the database, and you’ve said that sometimes the default values are not good enough. The only way to control that would be to ask the user with a dialog prompting if he wants to save the new “default” row, which could quickly turn into an annoyance.