Private Sub DataGridView1_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
If e.ColumnIndex > -1 And e.RowIndex > -1 Then
If TypeOf sender.Columns(e.ColumnIndex) Is DataGridViewButtonColumn And e.ColumnIndex = 0 Then
MsgBox("You are click row " & e.RowIndex)
End If
End If
End Sub
Private Sub DataGridView1_CellContentClick(ByVal sender As Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
If confirm("ยืนยันการลบข้อมูลหรือไม่?") = vbNo Then Return
If e.ColumnIndex > -1 And e.RowIndex > -1 Then
If TypeOf sender.Columns(e.ColumnIndex) Is DataGridViewButtonColumn And e.ColumnIndex = 0 Then
sql = "delete from pd3_jumbo where number_ncr = '" & e.ColumnIndex() & "'"
If cmd_excuteNonquery() = 0 Then
msgbox_fail("ลบไม่สำเร็จ")
Else
msgbox_ok("สำเร็จ")
End If
End If
End If
End Sub
Private Sub DataGridView1_CellContentClick(ByVal sender As Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
If confirm("ยืนยันการลบข้อมูลหรือไม่?") = vbNo Then Return
If e.ColumnIndex > -1 And e.RowIndex > -1 Then
If TypeOf sender.Columns(e.ColumnIndex) Is DataGridViewButtonColumn And e.ColumnIndex = 0 Then
sql = "delete from pd3_jumbo where number_ncr = '" & DataGridView1(2, e.ColumnIndex).Value & "'"
If cmd_excuteNonquery() = 0 Then
msgbox_fail("ลบไม่สำเร็จ")
Else
msgbox_ok("สำเร็จ")
refresh_pd3_jumbo()
End If
End If
End If
End Sub