این کد رو توی خط سوم اضافه کنی درست میشه
dataGridView1.ClearSelection();
یعنی در کل اینجوری میشه:
if (e.RowIndex != -1 && e.Button == MouseButtons.Right)
{
dataGridView1.ClearSelection();
dataGridView1.Rows[e.RowIndex].Selected = true;
}
این کد رو توی خط سوم اضافه کنی درست میشه
dataGridView1.ClearSelection();
یعنی در کل اینجوری میشه:
if (e.RowIndex != -1 && e.Button == MouseButtons.Right)
{
dataGridView1.ClearSelection();
dataGridView1.Rows[e.RowIndex].Selected = true;
}