private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { int accountid = 0; if (dataGridView1.Columns[e.ColumnIndex].Name == "Operate") { //可以在此打开新窗口,把参数传递过去 accountid = Convert.ToInt32(this.dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString()); model = temp.Where(x => x.AccountID == accountid).FirstOrDefault(); frmClientAccountEdit fm = frmClientAccountEdit.GetInstance(model); fm.Exec(model); fm.ShowDialog(); } }