<p>How do you select a datagridview row on a right-click?</p>

```
```
// Clear all the previously selected rows
    foreach (DataGridViewRow row in yourDataGridView.Rows)
    {
      row.Selected = false;
    }

    // Get the selected Row
    DataGridView.HitTestInfo info = yourDataGridView.HitTest( e.X, e.Y );

    // Set as selected
    yourDataGridView.Rows[info.RowIndex].Selected = true;
```
```