Hi, i have a datagridview : grd_ol and i added a button to it:
Dim btnColumn As New DataGridViewButtonColumn()
btnColumn.HeaderText = "Invoice"
btnColumn.Text = "View Invoice"
btnColumn.UseColumnTextForButtonValue = True
grd_ol.Columns.Add(btnColumn)
the table sort of looks like this:
| ORDER_ID | CUSTOMER_ID | STAFF_ID | ORDER_DATE | TOTAL(RM) | INVOICE |
| id1 | custid1 | staffid1 | 13/12/2016 | 12345 | 'View Invoice' |
| id2 | custid5 | staffid3 | 13/12/2016 | 178342 | 'View Invoice' |
| id3 | custid9 | staffid2 | 13/12/2016 | 1543 | 'View Invoice' |
how do i get the order_id of the row by buttonClick of 'view invoice'? is it on grd_ol_CellContentClick
?
i thought something like this would work but theres like a blue line and says End of statement expected
grd_ol.Rows[DataGridView.SelectedRows[0].Index].Cells[0].Value.ToString()