private void btn_editar_Click(object sender, EventArgs e) { if (this.dgv_Unidades.CurrentRow == null) { MessageBox.Show("Primero debes seleccionar una fila!"); } else { int id_unidad_actual = int.Parse(this.dgv_Unidades.CurrentRow.Cells[0].Value.ToString()); Form_M_Unidad_Modificar popUpEditar = new Form_M_Unidad_Modificar(this, id_unidad_actual); popUpEditar.Show(); this.Enabled = false; } }
private void mtEditar_Click(object sender, EventArgs e) { if (this.dgv_Unidades.CurrentRow == null) { MessageBox.Show("Primero debes seleccionar una fila!"); } else { //Se obtiene el id de la unidad en la fila seleccionada. int id_unidad_actual = int.Parse(this.dgv_Unidades.CurrentRow.Cells[0].Value.ToString()); //Se abre un formulario para ingresar los datos Form_M_Unidad_Modificar popUpEditar = new Form_M_Unidad_Modificar(this, id_unidad_actual); popUpEditar.Show(); this.Enabled = false; } }