private void btnModify_Click(object sender, EventArgs e) { int id = 0; try { id = (int)dgvContactList.CurrentRow.Cells[0].Value; } catch (System.Exception ex) { MessageBox.Show("请选择有效数据行!"); return; } FormContactDetail f = new FormContactDetail(id); f.ShowDialog(); Fill(); }
private void dgvContactList_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { int id = 0; try { id = (int)dgvContactList.CurrentRow.Cells[0].Value; } catch (System.Exception ex) { MessageBox.Show("请双击有效数据行!"); return; } FormContactDetail f = new FormContactDetail(id); f.ShowDialog(); Fill(); }