Skip to main content
All docs
V23.2

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