Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataGridViewButtonColumn

Status
Not open for further replies.

OhioSteve

MIS
Mar 12, 2002
1,352
US
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)

 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top