1. I have created a form with a datagridview that gets data from a datatable. The datagridview DOES display the correct data. One column contains a string that is unique for records in this datatable. In addition, I have added a column of buttons.
2. Right now the buttons do nothing when pressed.
3. When the user presses a button, I want the application to display a popup message reading "The identifier for this row is " + [identifier].
I suspect that I need to write an event handler, but I don't know how to proceed. Please advise.
PS: This is my form's onload event...
DataGridView1.AutoGenerateColumns = True
Dim dt As DataTable
dt = getDataTable("personnel")
DataGridView1.DataSource = dt
Dim dgvbc As New DataGridViewButtonColumn
With dgvbc
.DisplayIndex = 0
.UseColumnTextForButtonValue = True
.Text = "select"
.Width = 50
.HeaderText = "select employee"
End With
DataGridView1.Columns.Add(dgvbc)
2. Right now the buttons do nothing when pressed.
3. When the user presses a button, I want the application to display a popup message reading "The identifier for this row is " + [identifier].
I suspect that I need to write an event handler, but I don't know how to proceed. Please advise.
PS: This is my form's onload event...
DataGridView1.AutoGenerateColumns = True
Dim dt As DataTable
dt = getDataTable("personnel")
DataGridView1.DataSource = dt
Dim dgvbc As New DataGridViewButtonColumn
With dgvbc
.DisplayIndex = 0
.UseColumnTextForButtonValue = True
.Text = "select"
.Width = 50
.HeaderText = "select employee"
End With
DataGridView1.Columns.Add(dgvbc)