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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Button in Datagrid Row 1

Status
Not open for further replies.

dvannoy

MIS
May 4, 2001
2,765
US
I have a button in column 8 of a datagridview.

I'm trying to capture the value of a column depending on what row the user clicks on the button. I'm lost as to how to do this.

If e.ColumnIndex = 8 Then
MsgBox(dg.Rows(0).Cells(7).Value)
End If

any help would be appreciated

Thanks

 

You're almost there. Just use the RowIndex, like you already use the ColumnIndex:

If e.ColumnIndex = 8 Then
MsgBox(dg.Rows([red]e.RowIndex[/red]).Cells(7).Value)
End If

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top