Skip to main content
All docs
V23.2

DiagramEditOperation.DeleteShape Property

Identifies the DeleteShape operation.

Declaration

static readonly DeleteShape: string

Property Value

Type Description
string

Returns “DeleteShape”.

Remarks

The operation parameter returns the DeleteShape value if the RequestEditOperation event fired for the following reasons:

  • a user is about to delete a shape,
  • the ASPxDiagram control is updating the Cut and Delete command states (for instance, before displaying a context menu).

Use the reason parameter to identify the reason why the event fired.

<dx:ASPxDiagram ID="Diagram" runat="server" Width="100%" Height="600px">
    <ClientSideEvents RequestEditOperation="onRequestEditOperation" />
    ...
    if(e.operation === DiagramEditOperation.DeleteShape) {
        if(e.args.shape.type === "root") {
            if(e.reason !== DiagramRequestEditOperationReason.CheckUIElementAvailability)
                showWarning("You cannot delete the 'Development' shape.");
            e.allowed = false;
        }
        ...
    }

The RequestEditOperation event does not fire for the DeleteShape operation if the AllowDeleteShape property is set to false.

See Also