private void DgvDetalleCompra_SelectionChanged(object sender, EventArgs e) { try { if (isPedido) { cotPR = new DCotizacionPR(); Dgv2.DataSource = cotPR.SelectCotizacionesPRByCodStockAndCodPR((int)DgvDetalleCompra.SelectedRows[0].Cells[0].Value , (int)DgvPedidos.SelectedRows[0].Cells[0].Value); Dgv2.Refresh(); PersonalizarGridCotizacion(); } else { cotSC = new DCotizacionSC(); Dgv2.DataSource = cotSC.SelectCotizacionesSCByCodBienUsoAndCodSC((int)DgvDetalleCompra.SelectedRows[0].Cells[0].Value, (int)DgvSolicitudes.SelectedRows[0].Cells[0].Value); Dgv2.Refresh(); } } catch (Exception ex) { //MessageBox.Show($"Error: {ex.Message}", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } }
private void LimpiarGridsDetalles() { DgvDetalleCompra.DataSource = null; Dgv2.DataSource = null; DgvDetalleCompra.Refresh(); Dgv2.Refresh(); }
private void Dgv2_CellEnter(object sender, DataGridViewCellEventArgs e) { if (WithOpen) { return; } if (Dgv2.Columns[e.ColumnIndex].Name == "volent") { Dgv2.BeginEdit(true); } else { Dgv2.EndEdit(); } }
private void TableBrowser_KeyDown(object sender, KeyEventArgs e) { if (e.KeyData == Keys.Escape) { Close(); } if (e.KeyCode == Keys.Menu && e.Modifiers == Keys.Alt) { if (Dgv.Focused) { Dgv2.Focus(); } else { Dgv.Focus(); } e.Handled = true; } }