Results 1 to 7 of 7

Thread: [2005]DataGridView Error Handleing advice.

Threaded View

  1. #1

    Thread Starter
    Lively Member smilbuta's Avatar
    Join Date
    Apr 2005
    Location
    Orlando
    Posts
    104

    [2005]DataGridView Error Handleing advice.

    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.

    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
    Any advice is appreciated.
    Last edited by smilbuta; Apr 3rd, 2007 at 02:48 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width