prevent edit diagram

how to prevent edit diagram ?? but i need to work onlick 

1 Reply 1 reply marked as answer

GG Gowtham Gunashekar Syncfusion Team May 24, 2021 12:17 PM UTC

 
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

Marked as answer
Loader.
Up arrow icon