This project is read-only.

Get and Set X and Y coordinates of Vertex.

Feb 5, 2010 at 1:06 PM


Does anyone have a sample/workaround to get and set the X and Y Coordiantes of a vertex on a Bidirectional graph.

I am trying to drag and drop vertices from a list on the side onto the graph, which works, but they do not get created where I dropped them, they are created in the center of the screen.

Any ideas will be appreciated,


Feb 8, 2010 at 2:13 PM


I can drag and drop vertices from a list of icons onto the graph. I can also link them on the canvas with a line like link thing.

I just need to get and set the X and Y of the vertices for layout reasons.

How does the layout algorithms set the X and Y of the vertices? Is there some method I can call???




Jul 12, 2011 at 10:15 AM


IDictionary vertexPositions = new Dictionary(graph.VertexCount);
            vertexPositions = graphLayout.GetLatestVertexPositions();

but first you should change something, GetLatestVertexPositions() is a method in GraphSharp.Controls.GraphLayout change its return type from private to public