If I understand you right, you have found a work-around for you case.
However, I would still like to investigate the issue further.
For more information about how to handle events, see Handling and Raising Events.
Handle the Cell Validated event to perform post-validation processing.
When this event is canceled in virtual mode, the Cell Value Pushed event will not be raised.
When this event is canceled in data-bound mode, the new value is not pushed to the underlying data source.
Text = "Data Grid View validation demo (disallows empty Company Name)" End Sub Private Sub Form1_Load(By Val sender As System. All Cells Except Header) End Sub Private Sub data Grid View1_Cell Validating(By Val sender As Object, _ By Val e As Data Grid View Cell Validating Event Args) _ Handles data Grid View1. Header Text ' Abort validation if cell is not in the Company Name column. Equals("Company Name") Then Return ' Confirm that the cell is not empty.
For a complete explanation of this code example, see Walkthrough: Validating Data in the Windows Forms Data Grid View Control.
Form Private With Events data Grid View1 As New Data Grid View() Private binding Source1 As New Binding Source() Public Sub New() ' Initialize the form.
Data Grid View Cell Event Args) _ Handles data Grid View1.
Dim adapter As New Sql Data Adapter(select Command, connection String) Dim data As New Data Table() data.