Ejemplo n.º 1
0
        /// <summary>
        /// Define the Form link event
        /// </summary>
        private void lnkAdd_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            // Open form Tools
            // Populate grid
            frmTools frm = new frmTools();

            if (frm.ShowDialog() == DialogResult.OK)
            {
                PopulateGrid();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Define the DGV double click event
        /// </summary>
        private void dgvTools_DoubleClick(object sender, EventArgs e)
        {
            // If there is no cell selected, do nothing
            if (dgvTools.CurrentCell == null)
            {
                return;
            }

            // Get the primary key of the selected row, which is in column 0
            long pkID = long.Parse(dgvTools[0, dgvTools.CurrentCell.RowIndex].Value.ToString());

            frmTools frm = new frmTools(pkID);

            if (frm.ShowDialog() == DialogResult.OK)
            {
                PopulateGrid();
            }
        }