All docs
V20.2
20.2
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

ASPxClientDiagramRequestEditOperationEventArgs.reason Property

Identifies the reason why the event is raised.

Declaration

reason: DiagramRequestEditOperationReason

Property Value

Type Description
DiagramRequestEditOperationReason

A value that identifies the reason.

Remarks

The RequestEditOperation event fires to request information about edit operation availability. The reason event parameter identifies why the control requires this information.

  • The CheckUIElementAvailability value indicates that the control is updating the UI. Set the allowed property to false to hide the UI element associated with the specified operation.

  • The ModelModification value indicates if a user attempts an edit operation. You can specify whether to allow the operation and display an error message if a user tries to execute a prohibited action.

function onRequestEditOperation(s, e) {
  if(e.operation === DiagramEditOperation.ResizeShape) {
    if(e.args.newSize.width < 1 || e.args.newSize.height < 0.75) {
      if(e.reason !== DiagramRequestEditOperationReason.CheckUIElementAvailability)
        showWarning("The shape size is too small.");
      e.allowed = false;
    }
  }
  else if(e.operation === DiagramEditOperation.ChangeShapeText) {
    if(e.args.text === "") {
      if(e.reason !== DiagramRequestEditOperationReason.CheckUIElementAvailability)
        showWarning("The shape text cannot be empty.");
      e.allowed = false;
    }
  }
  ...
}

Run Demo: Editing Restrictions

See Also