current row key in data grid

  • Thread starter Thread starter Brian Henry
  • Start date Start date
B

Brian Henry

is there a simple way to get the currently selected row's key in a bound
data grid in winforms? thanks
 
Brian,
Is this what you want?
Dim intMyRow As Integer

Dim cellItm As DataGridCell

Dim MyKey As Integer

cellItm = MyGrid.CurrentCell

intRow = cellItm.RowNumber

MyKey = MyGrid(intRow, 1).ToString

Doug
 
thanks!

Doug Bell said:
Brian,
Is this what you want?
Dim intMyRow As Integer

Dim cellItm As DataGridCell

Dim MyKey As Integer

cellItm = MyGrid.CurrentCell

intRow = cellItm.RowNumber

MyKey = MyGrid(intRow, 1).ToString

Doug
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top