private void EliminarDetalle_Click(object sender, EventArgs e) { var result = MessageBox.Show("Desea Eliminar el detalle seleccionado?", " ", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { if (RowSelected >= 0) { Monto -= FacturacionBLL.RecalcularImporte(facturas.Detalle, RowSelected); MontotextBox.Text = Monto.ToString(); Arreglar = true; FacturaDetalle factura = facturas.Detalle.ElementAt(RowSelected); Detalle.Add(new FacturaDetalle(factura.Id, factura.FacturaId, factura.ProductoId, factura.Cantidad, factura.Precio, factura.Descripcion, factura.Importe)); facturas.Detalle.RemoveAt(RowSelected); FacturadataGridView.DataSource = null; FacturadataGridView.DataSource = facturas.Detalle; RowSelected = -1; if (paso) { AsignarDevuelta(); } MessageBox.Show("Eliminado!"); } } }