Force the graph to redraw itself

Hello Walter,

I am not redrawing my graph in some conditions using layout.Conditions = "None". (Ref:
Now I need to force the control to redraw itself. It means on button click all the nodes and the links in the graph should be rearranged.
How can I do this programatically?
How can we force the graph to redraw (rearrange nodes and links) programatically?
Thanks and Regards,

You can use diagram.LayoutDiagram() assuming diagram is the name of you Diagram control.
Off course you will have to change the Conditions from None to something else.


Yes, as Ido says, you can just call Diagram.LayoutDiagram() whenever you want.

However, you do not need to change any DiagramLayout.Conditions property. The Conditions property just controls the state changes under which a layout will be invalidated, causing a re-layout sometime in the future. But the LayoutDiagram() method explicitly invalidates all layouts, so they will all be performed again regardless of their Conditions value.