Hi Stoyan,
Thanks for the code, but I'm a bit confused about how to make it work.
Here's what I have so far, which creates a small window (500px X 500px), but the node is not visible in this window (not even close actually).
In fact the slider on the horizontal scrollbar is at the far left, and the slider on the vertical scrollbar is at the top - so it doesn't look like the scroll position was adjusted at all.
Is there something I need to do after setting the view's ScrollX/Y?
Thanks again.
Jim
DiagramView3.Height = Unit.Parse("500px");
DiagramView3.Width = Unit.Parse("500px");
DiagramNode root = diagram.Nodes[0]; // Locate the root node which is the Process Name
System.Drawing.RectangleF viewSize = DiagramView3.ClientToDoc(new System.Drawing.Rectangle(0, 0, 500, 500));
DiagramView3.ScrollX = root.GetCenter().X - viewSize.X / 2;
DiagramView3.ScrollY = root.GetCenter().Y - viewSize.Y / 2;
[/code]
And here's the DiagramView declaration:
<ndiag:DiagramView ID="DiagramView3" runat="server" Behavior="Pan" ClientSideMode="ImageMap"
JsLibraryLocation="./Js/MindFusion.Diagramming.js" JarLocation="./Java/JDiagram.jar"
AppletStartedScript="onAppletStarted" ShowScrollbars="true" ShowOverview="false"
OverviewFitAll="true" OverviewTitle="Navigator" Diagram-EnableStyledText="true" ZoomFactor="100">
</ndiag:DiagramView>