获取dataGridView双击时判断双击的是下面的行,还是列头
private void dataGridView1_DoubleClick(object sender, EventArgs e)
{
Point hit = this.dataGridView1.PointToClient(Cursor.Position);
DataGridView.HitTestInfo hitTest = this.dataGridView1.HitTest(hit.X, hit.Y);
MessageBox.Show(hitTest.Type + " Row=" + hitTest.RowIndex + " Col" + hitTest.ColumnIndex);
}