how to get the index of a selected row in datagridview c# code example Example: c# datagridview selected row index datagridview.CurrentCell.RowIndex