Пример #1
0
        private void inkAddMovie_MouseClick(object sender, MouseEventArgs e)
        {
            // Initialize a new frmMovie
            frmMovie frm = new frmMovie();

            // Show the new form
            // If the form returns the DialogResult OK
            // Populate the DataGridView
            if (frm.ShowDialog() == DialogResult.OK)
            {
                PopulateGrid();
            }
        }
Пример #2
0
        private void dgvMovies_DoubleClick(object sender, EventArgs e)
        {
            // Check if a cell has been selected in the DataGridView
            // If not stop the method
            if (dgvMovies.CurrentCell == null)
            {
                return;
            }

            // Create and assign the primary key of the DataGridView
            long pkID = long.Parse(dgvMovies[0, dgvMovies.CurrentCell.RowIndex].Value.ToString());

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

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