示例#1
0
        private void lnkAdd_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            frmCustomer frm = new frmCustomer();

            if (frm.ShowDialog() == DialogResult.OK)
            {
                PopulateGrid();
            }
        }
示例#2
0
        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();
            }
        }