It's that simple. How do I get the index of the currently selected Row of a DataGridView? I don't want the Row object, I want the index (0 .. n).
Row
DataGridView
There is the RowIndex property for the CurrentCell property for the DataGridView.
RowIndex
CurrentCell
datagridview.CurrentCell.RowIndex
Handle the SelectionChanged event and find the index of the selected row as above.
SelectionChanged
1.4m articles
1.4m replys
5 comments
57.0k users