"Ghost" Polylines after removing from Repository/Diagram

Nov 21, 2016 at 11:15 PM
Hi, I created a diagram programmatically, it has multiple layers, one of those layers holds shapes that need to be removed regularly, so I delete them using the function below.

After deleting the shapes the polyline shapes still show up (grayed-out) when moving the shapes they were connected to before.

Any leads will be appreciated.

Thanks.

David
        public static void DeleteLayerShapes(Dataweb.NShape.WinFormsUI.Display Display, Project Project, Layer Layer)
        {

            Project.Repository.DeleteAll(Display.Diagram.Shapes.Where(s => Display.Diagram.Layers.GetLayer(Display.Diagram.GetShapeLayers(s)).Id == Layer.Id));

            Display.Diagram.Shapes.RemoveRange(Display.Diagram.Shapes.Where(s => Display.Diagram.Layers.GetLayer(Display.Diagram.GetShapeLayers(s)).Id == Layer.Id));
                   
        }
Coordinator
Apr 11 at 8:31 AM
Sorry, I oversaw your post. Seems that notification EMail does not work any longer. :-(
After deleting the shapes the polyline shapes still show up (grayed-out) when moving the shapes they were connected to before.
You have to disconnect the shapes before deleting them.
NShape does not auto-disconnect shapes because you could insert them again. In this case - when using a database repository - auto-disconnecting and re-connecting would cause unnecessary database load. That is why NShape leaves it to the programmer to disconnect connections.