The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Hi,
I have a application which determines whether a node on diagram can be drag from position "A" to position "B". If it cannot be moved to "B", it will be repositioned to "A". I do the check and repositioning in NodeMoved event handler. However, NodeMoved event recursively happened and causes stack overflow exception. Is there any way to stop NodeMoved event after reposition nodes?
Denny
ADAdministrator Syncfusion Team December 28, 2005 08:42 PM UTC
Hi Denny,
The Essential Diagram Model class has an EventsEnabled property that you can set to temporarily disable diagram events from being propagated. Please see if disabling this property from within your NodeMoved event handler just before applying the new bounds and re-enabling it after setting it helps avoid the recursion.
Thanks,
Prakash Surendra
Syncfusion Inc.,
DHDenny HuangDecember 29, 2005 01:59 AM UTC
Hi Surendra,
Thank you! set EventsEnabled property works fine.
FYI: another way to get the same result: unhook the handler before applying the new bounds and hook it back after setting it.
Thanks,
Denny
>Hi Denny,
>
>The Essential Diagram Model class has an EventsEnabled property that you can set to temporarily disable diagram events from being propagated. Please see if disabling this property from within your NodeMoved event handler just before applying the new bounds and re-enabling it after setting it helps avoid the recursion.
>
>Thanks,
>Prakash Surendra
>Syncfusion Inc.,