Open thesur opened 5 years ago
Please have a look at Editing sample. Adding nodes works there.
Thanks Levnach.
I have already looked at it, but still strugling.
I tried to replicate the same code ...
Microsoft.Msagl.Drawing.Node test = new Microsoft.Msagl.Drawing.Node("hola");
IViewerNode dNode = viewer.CreateIViewerNode(test, m_MouseRightButtonDownPoint, null);
viewer.AddNode(dNode, true);
But when calling the .AddNode functionality I get a NullReferenceException (none of my parameters are null). Is there any requierement to initialize the gviewer object?
Is there any documentation that I could read?
Sorry, there is no documentation on this.
I have a graph in which I have added a few nodes. After adding the nodes, I assign the graph to the viewer and they are displayed.
However, if later I want to add more nodes, the graph is not automaticately updated, so I have to assign again the graph to the viewer to refresh it.
This is how I have created the viewer and graph:
And this is how I'm adding new Nodes. These nodes are not rendered in the graph automaticatly:
So, in order to refresh the graph, I have to do this:
Am I doing this wrong? What is the proper way to add the nodes to the graph and them being displayed automaticatly without having to reasign the 'Graph' property of the viewer?
Thank you, Manuel