We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

OnDrop(IBlazorDropEventArgs args) - only works for first time node dropped to NEW diagramcontrol - what about drag and drop of existing nodes

OnDrop(IBlazorDropEventArgs args) - only works for first time node dropped to diagram control - what about drag and drop of existing nodes


Example: Dragging from stencil to diagramcontrol (not the classic one) does fire the OnDrop event however when we drag and drop the SAME new node which is now already on the diagram it does NOT fire ondrag ondrop etc events? Is there a way to ensure existing node drag and drop events fire and can be intercepted.

Example: We want to be able to detect target node when one node is dropped onto another existing node - NOT from stencil - nodes and groups already on the diagram.


1 Reply

BR Balavignesh RaviChandran Syncfusion Team March 3, 2023 09:19 AM UTC

PositionChanging and PositionChanged events are used to detect the dragging and dropping of any nodes within the diagram canvas. In these events, you will get the source node and the current position of the node from the corresponding event arguments.

 

For more information regarding the PositionChanged and PositionChanging events, please refer to the following UG link.
https://blazor.syncfusion.com/documentation/diagram/nodes/events#position-change-event


If the requirement is to detect the target node after the drop, then you can use the DragDrop event, where you will get the target node from the event arguments. The DragDrop event can be invoked by enabling the AllowDrop constraints in the target node, which shows the highlighters when you drag the node and mouse hover on another node.

 

For more information regarding the DragDrop event, please refer to the following UG link:
https://blazor.syncfusion.com/documentation/diagram/events#dragdrop-event

 

Note: The OnDrop (IBlazorDropEventArgs args) event belongs to our Classic SfDiagram control. We suggest you use SfDiagramComponent since it will provide better performance than SfDiagram and SfDiagramComponent will be actively developed in the future. You can use SfDiagramComponent to build a rich diagram editor-style application. For your reference, we have shared our online help documentation and a demo link.

 

UG: https://blazor.syncfusion.com/documentation/diagram/getting-started

 

Demo: https://blazor.syncfusion.com/demos/diagramcomponent/flowchart?theme=fluent



Loader.
Live Chat Icon For mobile
Up arrow icon