New to Telerik UI for WinForms? Download free 30-day trial

Removing items

RadDiagram gives you the ability to remove RadDiagramItems interactively, programmatically or with DiagramCommands.

Removing Items Interactively

You can remove the selected RadDiagramItems by pressing the Delete Key.

Below you can see the result of delete operation over the selected RadDiagramItems:

WinForms RadDiagram Removing Items Interactively

Removing Items in code behind

You can remove RadDiagramItems in code behind by using the RadDiagram.Items collection and its Remove() or RemoveAt() methods:



Delete with DiagramCommands

You can use the DiagramCommand "Delete" in order to remove the selected RadDiagramItems.

this.radDiagram1.SelectedItem = shape1;
this.radDiagram1.DiagramElement.TryExecuteCommand(DiagramCommands.Delete, "");

Me.RadDiagram1.SelectedItem = shape1
Me.RadDiagram1.DiagramElement.TryExecuteCommand(DiagramCommands.Delete, "")

In this article