private void InicializarFormulario() { Lbl_Equipo.Text = Equipo.Equipo; ActivarPanel((Equipo.ProductosAdicionales.Count == 0)); Dtg_Detalles.AutoGenerateColumns = false; Dtg_Detalles.DataSource = null; if (Equipo.ProductosAdicionales.Count > 0) { Dtg_Detalles.DataSource = Equipo.ProductosAdicionales; } Dtg_Detalles.Refresh(); this.Refresh(); }
private void Dtg_Detalles_CellValueChanged(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex == -1) { return; } DataGridViewRow FilaSeleccionada = Dtg_Detalles.Rows[e.RowIndex]; string Valor = FilaSeleccionada.Cells[e.ColumnIndex].Value.ToString(); if (string.IsNullOrEmpty(Valor)) { FilaSeleccionada.Cells[e.ColumnIndex].Value = "1"; } NDetalle = (ENT.Detalles_ENT)FilaSeleccionada.DataBoundItem; NDetalle.CalcularTotal(); Dtg_Detalles.Update(); Dtg_Detalles.Refresh(); Factura.GuardarItem(Equipo, NDetalle); }