Cannot See Layer

Hello,

I’m using GoDiagram 2.5.2.2, and I am having a problem using multiple GoLayers in a single document. My goal is the following: I want to have one layer with GoNodes on it and another with GoShapes. This is all in my own GoView which is derived off of GoView. In the constructor for my view I do the following:

InitializeComponent();

Document.SuspendsUpdates = true;
shapesLayer = Document.Layers.CreateNewLayerBefore(Document.DefaultLayer);
shapesLayer.Identifier = “Shapes”;
Document.SuspendsUpdates = false;

The problem is that when I add shapes to the shapesLayer, I cannot see them. I inserted a breakpoint in my code just after the shape has been added and noted the following:

  1. The shapesLayer is not null
  2. The shapesLayer.Document is equal to this.Document and shapesLayer.IsInDocument is true
  3. shapesLayer.View is null and shapesLayer.IsInView is false.
  4. shapesLayer.AllowView is true.
  5. shapesLayer.Count correctly reflects the shapes which have been added to it. this.Document also reflects the added shapes.

I also tried moving the shapes from one layer to another, and while they were visible in the DefaultLayer, they became invisible as soon as they were moved to the shapes layer. I have tried both CreateNewLayerBefore and CreateNewLayerAfter and neither work.

Thanks in advace for your help with this issue. I’d be happy to provide more information about what I’m doing here as necessary, as there is already alot of code in this custom GoView.

-Matt

Remove the SuspendsUpdates lines.

Thanks Jake! I don’t really know why that worked, but it seems to have.