private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == dataGridView1.Columns["cRemark"].Index) { string _model = dataGridView1.Rows[e.RowIndex].Cells["cModel"].Value.ToString(); string _norm = dataGridView1.Rows[e.RowIndex].Cells["cNorm"].Value.ToString(); frmViewDetail fr = new frmViewDetail(_norm,_model); fr.ShowDialog(); } }
/// <summary> /// 单击单元格内容时发生 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == dataGridView1.Columns["cRemark"].Index) { string _model = dataGridView1.Rows[e.RowIndex].Cells["cModel"].Value.ToString(); string _norm = dataGridView1.Rows[e.RowIndex].Cells["cNorm"].Value.ToString(); frmViewDetail fr = new frmViewDetail(_norm, _model); fr.ShowDialog(); } }