How to get DataGrid Field value for Selected Row?

  • Thread starter Thread starter cgchris99
  • Start date Start date
C

cgchris99

Guest
I have a Datagrid that is from a table.
When I highlight the row, and click my select button, how do I know what the value of a certain column is?

Thanks for any advice
 
You can do this for column number....
MessageBox.Show(myGrid1.CurrentCell.ColumnNumber.ToString)

Row number...
MessageBox.Show(myGrid1.CurrentCell.RowNumber.ToString)

Both row and column (as string)
MessageBox.Show(myGrid1.CurrentCell.ToString)
 
Back
Top