Hi Tharaka,
Please refer to the following sample for how to prevent the diagram from edit by button click. In the sample we have added a two button, first button for set the diagram in edit mode and another button for prevent diagram from edit. We have to set the diagram constraints for “Default” for edit mode and we have to set diagram constraints as “None for prevent the diagram from edit.
Code snippet:
|
public editDiagram() {
// to enable edit mode
this.diagram.constraints = DiagramConstraints.Default;
}
public preventeditDiagram() {
this.diagram.clearSelection();
// to disable edit mode.
this.diagram.constraints = DiagramConstraints.None;
} |
Regards,
Gowtham