private void TxtBusqueda_KeyPress(object sender, KeyPressEventArgs e) { try { if (e.KeyChar == '\r') { e.Handled = true; ProductoBL busqueda = new ProductoBL(); if (rbNombre.Checked == true) { dgvProd.DataSource = busqueda.BusquedaProducto(txtBusqueda.Text, rbNombre.Text); } else if (rbPrecio.Checked == true) { dgvProd.DataSource = busqueda.BusquedaProducto(txtBusqueda.Text, rbPrecio.Text); } } } catch (Exception) { throw; } }