Пример #1
0
        private void btnAlta_Click(object sender, EventArgs e)
        {
            //this.Hide();
            RolAltaForm altaForm = new RolAltaForm();

            altaForm.RefToRolForm = this;
            altaForm.Show();
        }
        private void dgvRoles_CellContentClick_1(object sender, DataGridViewCellEventArgs e)
        {
            var senderGrid = (DataGridView)sender;

            if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn &&
                e.RowIndex >= 0)
            {
                DataGridViewRow selectedRow     = dgvRoles.Rows[e.RowIndex];
                string          selected_rol_id = Convert.ToString(selectedRow.Cells["rol_id"].Value);

                RolAltaForm altaForm = new RolAltaForm(selected_rol_id);
                altaForm.Show();
                altaForm.RefToRolForm          = this.RefToRolForm;
                dgvRoles.AllowUserToAddRows    = false;
                dgvRoles.AllowUserToDeleteRows = false;
                dgvRoles.ReadOnly = true;
            }
        }