Index: VerpakkingsDefinitie/UI/ProductDetailScherm.pas =================================================================== diff -u -r601 -r606 --- VerpakkingsDefinitie/UI/ProductDetailScherm.pas (.../ProductDetailScherm.pas) (revision 601) +++ VerpakkingsDefinitie/UI/ProductDetailScherm.pas (.../ProductDetailScherm.pas) (revision 606) @@ -106,11 +106,19 @@ end; procedure TFormProductDetail.ButtonVerwijderVerpakkingClick(Sender: TObject); +var + IndexInList: Integer; begin + IndexInList := ListViewVerpakkingen.ItemIndex; + FProductsAgent.VerwijderVerpakking(ApplicationContext.ProductVerpakkingContext.GeselecteerdeVerpakking, ApplicationContext.UserContext, ApplicationContext.ProductVerpakkingContext); VerwerkAgentVerpakkingCall(); + + // Selecteer de verpakking net voor de verwijderde verpakking. + if (self.ApplicationContext.ProductVerpakkingContext.IsOK) and (IndexInList > 0) then + ListViewVerpakkingen.ItemIndex := IndexInList - 1; end; procedure TFormProductDetail.VerwerkAgentVerpakkingCall(); @@ -203,7 +211,6 @@ SubItems.Add(ProductVerpakking.Aantal); SubItems.Add(ProductVerpakking.MaxCombinAantal); SubItems.Add(ProductVerpakking.DeelVanCaption); - SubItems.Add(ProductVerpakking.ID); end; end; ListViewVerpakkingen.Items.EndUpdate;