Information générale
Catégorie:
The Mere Mortals .NET Framework
Titre:
Grid validating on cancel()
I am processing an invoice with an invoice table (bound controls) and a child InvoicesItems table (bound in DataGridView).
After adding items in the DataGridView, I call the Form.Cancel(BizObj, DataView). I get an error when the DataGridView RowValidating() routine fires. I was suprised that the RowValidating event fired when I was cancelling. When the error occurs, I have 0 rows in my InvoicesItems business object and 3 rows in my DataGridView. I called Cancel() based on a keypress, so I never changed focus from the datagridview. It also happens if I move the focus away from the grid.
It only happens if I have 2 or more rows in the DataGridView. I have AllowUserToAddRows() = true.
Should the RowValidating() be firing?
Thanks,
Jeff
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement