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

NodeMoved Event

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

2 Replies

AD Administrator 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.,


DH Denny Huang December 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.,

Loader.
Live Chat Icon For mobile
Up arrow icon