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

Clipboard operations

RadDiagram gives you the ability to Cut, Copy and Paste RadDiagramItems within an application.

Cut, Copy, Paste with keyboard

By default, the AllowCopy, AllowCut and AllowPaste properties are set to true but you can set then to false in order to disable these Clipboard operations.

In order to cut, copy or paste particular RadDiagramItems you have to select them and use the standard keyboard combinations:

  • (Ctrl + C) - copies the selected items.

  • (Ctrl + X) - cuts the selected items.

  • (Ctrl + V) - pastes the selected items.

You can perform these operations in a single form, but you can also copy/cut and paste items between several forms.WinForms RadDiagram Clipboard Operations

Cut, Copy, Paste with DiagramCommands

You can use the DiagramCommands "Cut", "Copy" and "Paste" in order to perform the standard clipboard operations.

this.radDiagram1.SelectedItem = shape1;
this.radDiagram1.DiagramElement.TryExecuteCommand(DiagramCommands.Copy, "");
this.radDiagram2.DiagramElement.TryExecuteCommand(DiagramCommands.Paste, "");
this.radDiagram1.SelectedItem = shape2;
this.radDiagram1.DiagramElement.TryExecuteCommand(DiagramCommands.Cut, "");
this.radDiagram2.DiagramElement.TryExecuteCommand(DiagramCommands.Paste, "");

Me.RadDiagram1.SelectedItem = shape1
Me.RadDiagram1.DiagramElement.TryExecuteCommand(DiagramCommands.Copy, "")
Me.RadDiagram2.DiagramElement.TryExecuteCommand(DiagramCommands.Paste, "")
Me.RadDiagram1.SelectedItem = shape2
Me.RadDiagram1.DiagramElement.TryExecuteCommand(DiagramCommands.Cut, "")
Me.RadDiagram2.DiagramElement.TryExecuteCommand(DiagramCommands.Paste, "")

In this article