I am trying to automatically LEAVE a DataGridView Cell after entering 2 characters, (without pressing Enter or Tab keys).
I have exhausted all options and am hoping there is a guru out there who can help. I have experimented with Events such as CellValueChanged, and EditingControlShowing, but I can
Comments
I had a problem with the "EditingControlShowing" event firing multiple times. Got around it with the following code.
Private Sub dgView1_EditingControlShowing(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewEditingControlShowingEventArgs) Handles dgView1.EditingControlShowing
If Formloading = True Then Exit Sub
If Not e.Control Is Nothing Then
RemoveHandler e.Control.TextChanged, New EventHandler(AddressOf CellTextChanged)
AddHandler e.Control.TextChanged, New EventHandler(AddressOf CellTextChanged)
End If
End Sub
Note: Formloading is a local variable. Removing the handler was the trick; otherwise the handler is assigned multiple times.