There are several ways to control user actions on the diagram as a whole, or on individual items in the diagram.
The Behavior property provides several predefined sets of rules specifying how user input with the mouse is interpreted. If Behavior is set to LinkShapes, mouse dragging started from an unoccupied point of the document is processed as a ShapeNode creation request and dragging over a node creates a link. Additional members of the Behavior enumeration provide more limited interaction modes.
The text of nodes and links can be edited in-place by double-clicking the respective items. To enable this feature, set the AllowInplaceEdit property to true. Depending on the type of item, the control raises either the nodeTextEdited, cellTextEdited or linkTextEdited event when its text has been edited. In-place editing mode is exited when users click outside the text entry control.
By default, the control creates a textarea DOM element over an item to allow editing the item's text. If you prefer using a different type of element as in-place editor, handle the createEditControl event and set the Control property of the provided InplaceEditEventArgs object.
While the user draws new nodes or links, the control raises the nodeCreating or linkCreating events after each change of the mouse position. By calling the setCancel method of the event object, you can prevent the operation from being completed at the current position but let the user continue drawing. Calling the cancelDrag method immediately stops the operation. The nodeModifying and linkModifying events provide the same functionality during modification of existing objects. Finally, if the user tries to delete an item, you can handle the nodeDeleting or linkDeleting event to prevent this.