private void lnkAdd_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { frmCustomer frm = new frmCustomer(); if (frm.ShowDialog() == DialogResult.OK) { PopulateGrid(); } }
private void dgvCustomers_DoubleClick(object sender, EventArgs e) { // if no current row or cell selected, do nothing if (dgvCustomers.CurrentCell == null) { return; } // Get the primary key id of the selected row, which is in column 0 long pkId = long.Parse(dgvCustomers[0, dgvCustomers.CurrentCell.RowIndex].Value.ToString()); frmCustomer frm = new frmCustomer(pkId); if (frm.ShowDialog() == DialogResult.OK) { PopulateGrid(); } }