The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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
ADAdministrator 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.