Greetings Community...
I Need advice.
I have created an error handler for a DatagridView. I want to know if this is the most efficient way to handle the event or might one of you see a quicker more consice method.THe handler works but i think it may not be as clean as it could be. The event is catching a invalid commit event.
Any advice is appreciated.Code:Private Sub EQ_EquipmentDataGridView_DataError(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewDataErrorEventArgs) Handles EQ_EquipmentDataGridView.DataError Dim errorContext As String = "Commit" If errorContext = CStr(e.Context) Then Try Me.EQ_EquipmentDataGridView.CancelEdit() Catch ex As Exception MessageBox.Show(ex.Message) End Try End If End Sub




Reply With Quote