Edit this page

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:

diagram-items-manipulation-removing-items 001

Removing Items in code behind

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

this.radDiagram1.Items.RemoveAt(2);
this.radDiagram1.Items.Remove(shape1);

Me.RadDiagram1.Items.RemoveAt(2)
Me.RadDiagram1.Items.Remove(shape1)

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, "")

Was this article helpful? Yes No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy