I have the following code in datagridview WinForms for handling right clicks to select a base row:
private void dataGridViewTestSteps_MouseDown(object sender, MouseEventArgs e) { if (e.Button != MouseButtons.Right) return; var hitTestInfo = dataGridViewTestSteps.HitTest(eX, eY); dataGridViewTestSteps.ClearSelection(); dataGridViewTestSteps.Rows[hitTestInfo.RowIndex].Selected = true; }
... now this works fine, but does not put the small indicator on the correct line (see image below). So basically I was wondering what is missing in the method above?

source share