We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Remove Links (or clear diagram)

I have a diagram control to which I add rectangle symbols via the InsertNodesCmd. I then link these rectangles using the LinkCmd. I then want to clear the diagram. I can remove the rectangle symbols by using the RemoveNodesCmd. How can I remove the links, or better still is there a quick way to clear a diagram? Thanks in advance, Nick

2 Replies

AD Administrator Syncfusion Team May 31, 2006 07:27 AM UTC

Hi Nick, Thanks for your interest in Syncfusion. If your intention is to remove\delete any particular node please try the following method, // Deletes the selected node(s). this.diagram.Controller.Delete(); Also, if you need to clear the nodes on the Diagram, then you can go with this by using the LayerCollection.RemoveAllMembers() method that removes all the nodes and layers as well. private void button_ClearNodes_Click(object sender, System.EventArgs e) { LayerCollection layers = this.diagram1.Model.Layers as LayerCollection; this.diagram1.Controller.SelectionList.Clear(); // RemoveAllMembers() method clears out every layer in the collection. layers.RemoveAllMembers(); this.diagram1.Controller.UpdateAllViews(); } I hope this information will help you. Please let me know if you need any further assistance. Regards, Praveena.


NG Nick Gardner May 31, 2006 10:33 AM UTC

Super, thanks!

Loader.
Live Chat Icon For mobile
Up arrow icon