//获取某行某列
//第一种方式
int row = e.RowIndex;
int col = e.ColumnIndex;
//第二种方式
//int row = dataGridView1.CurrentCell.RowIndex + 1;
//int col = dataGridView1.CurrentCell.ColumnIndex + 1;
//第三种方式
//int row = dataGridView1.CurrentCellAddress.Y + 1;
//int col = dataGridView1.CurrentCellAddress.X + 1;
//第四种方式
//int row = dataGridView1.CurrentRow.Index + 1;
//获取指定位置值
//第一种方式
//String value = dataGridView1.CurrentCell.Value.ToString();
//第二种方式
String value = dataGridView1.Rows[row].Cells[col].Value.ToString();
MessageBox.Show("第" + row + "行" + "第" + col + "列" + "值为" + value);
//第一种方式
int row = e.RowIndex;
int col = e.ColumnIndex;
//第二种方式
//int row = dataGridView1.CurrentCell.RowIndex + 1;
//int col = dataGridView1.CurrentCell.ColumnIndex + 1;
//第三种方式
//int row = dataGridView1.CurrentCellAddress.Y + 1;
//int col = dataGridView1.CurrentCellAddress.X + 1;
//第四种方式
//int row = dataGridView1.CurrentRow.Index + 1;
//获取指定位置值
//第一种方式
//String value = dataGridView1.CurrentCell.Value.ToString();
//第二种方式
String value = dataGridView1.Rows[row].Cells[col].Value.ToString();
MessageBox.Show("第" + row + "行" + "第" + col + "列" + "值为" + value);