给dataGridView增加一个鼠标CellMouseDown
事件
private void dataGridView_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e)
{
Console.WriteLine(e.RowIndex);
if (e.RowIndex != -1)
{
this.dataGridView.CurrentCell = this.dataGridView.Rows[e.RowIndex].Cells[1];
}
}