private void btnEditar_Click(object sender, EventArgs e) { FormMantProducto frm = new FormMantProducto(); if (dataGridView1.SelectedRows.Count > 0) { frm.txtid.Text = dataGridView1.CurrentRow.Cells[0].Value.ToString(); frm.txtcategoria.Text = dataGridView1.CurrentRow.Cells[1].Value.ToString(); frm.txtdescrip.Text = dataGridView1.CurrentRow.Cells[2].Value.ToString(); frm.txtprecio.Text = dataGridView1.CurrentRow.Cells[3].Value.ToString(); frm.txtstock.Text = dataGridView1.CurrentRow.Cells[4].Value.ToString(); frm.ShowDialog(); } else { MessageBox.Show("debe seleccionar fila"); } }
private void btnNuevo_Click(object sender, EventArgs e) { FormMantProducto frm = new FormMantProducto(); frm.ShowDialog(); }