Articles in this section

How to prevent node selection programatically using Angular Diagram?

This article explains how to prevent node selection programmatically using Angular Diagram. In the Syncfusion® Angular Diagram, the selectionChange event is triggered when selecting diagram elements either through user interaction or programmatically. Within the selectionChange event, you can prevent the selection of a node by setting a boolean value. By default, this value is set to false. When a node is dynamically selected, this boolean value is set to true.

Based on this boolean value, the selection of the node is restricted within the selectionChange event by setting the args.cancel property to true. This prevents the node from being selected.

 public isSelect: boolean = false;
 public selectionChange(args: ISelectionChangeEventArgs): void {
       if (this.isSelect === true) {
         //Do your logic
         args.cancel = true;
       }
       this.isSelect = false;
     }

Refer to the working sample for additional details and implementation: Sample

Conclusion

We hope you enjoyed learning about how to prevent node selection programmatically using Angular Diagram.

You can refer to our Angular Diagram feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our Angular Diagram example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, BoldDesk Support, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied