Private Sub dgDataGrid1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgDataGrid1.CellContentClick
'*** If user clicks on the column or row headers, ignore and exit ***
If (e.ColumnIndex < 0) Or (e.RowIndex < 0) Then
Exit Sub
End If
'*** If user clicks on the "EDIT" button, proceed to View/Edit screen ***
If (e.ColumnIndex = 0) Then
ViewGUID = dgDataGrid1.Rows.Item(e.RowIndex).Cells(1).Value.ToString.Trim
ViewQuoteNumber = dgDataGrid1.Rows.Item(e.RowIndex).Cells(4).Value.ToString.Trim
ViewSerialNumber = dgDataGrid1.Rows.Item(e.RowIndex).Cells(6).Value.ToString.Trim
ViewProductionPlant = dgDataGrid1.Rows.Item(e.RowIndex).Cells(8).Value.ToString.Trim
Console.Write("Preparing to View/Edit: " & ViewGUID & " - " & ViewSerialNumber & " - " & ViewProductionPlant & vbCr)
Me.Hide()
frmViewEdit.Show()
My.Application.DoEvents()
End If
End Sub