Beispiel #1
0
        private void inkAddCustomer_Click(object sender, EventArgs e)
        {
            // Create a new instance of frmCustomer
            frmCustomer frm = new frmCustomer();

            // Show the form
            // If the form returns DialogResult OK
            // Populate the DataGridView
            if (frm.ShowDialog() == DialogResult.OK)
            {
                PopulateGrid();
            }
        }
Beispiel #2
0
        private void DgvCustomers_DoubleClick(object sender, EventArgs e)
        {
            // Check if a cell has been selected in the DataGridView
            // If not then stop the method
            if (dgvCustomers.CurrentCell == null)
            {
                return;
            }

            // Create and assign the DataGridView Primary Key
            long pkID = long.Parse(dgvCustomers[0, dgvCustomers.CurrentCell.RowIndex].Value.ToString());

            // Create a new instance of frmCustomer (with the Primary Key)
            frmCustomer frm = new frmCustomer(pkID);

            // Show the form
            // If the form returns DialogResult OK
            // Populate the DataGridView
            if (frm.ShowDialog() == DialogResult.OK)
            {
                PopulateGrid();
            }
        }