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.
Unfortunately, activation email could not send to your email. Please try again.

Raise an event before Delete

Thread ID:

Created:

Updated:

Platform:

Replies:

89884 Sep 9,2009 12:12 PM Sep 11,2009 02:09 AM Windows Forms 3
loading
Tags: Diagram
Stephane Guerillot
Asked On September 9, 2009 12:12 PM

Hello,

I have a Diagram containing different Nodes. I would like to catch an event before any suppression of Nodes.

I tried, to override the ProcessKeyDown and ProcessKeyUp functions in a custom SelectTool (inheriting from SelectTool, and registered instead the original one), but the events seemed to be raised after suppression. Same result with the Windows EventHandler (OnKeyDown).

How can I have access to the Controller.SelectList before suppression ?

Thanks for your answer.

Gowri Manohari D [Syncfusion]
Replied On September 10, 2009 05:41 AM

Hi Stephane,

Thank you for choosing Syncfusion products.

Diagram does not have specific for NodeDelete. We can indirectly trigger some event before delete. For that we can EventSink_NodeCollectionChanging Event, it will fire adding or removing the nodes in diagram. We can achieve your requirement with the help of this method. Please refer the code snippet.

diagram1.Model.EventSink.NodeCollectionChanging+=new CollectionExEventHandler(EventSink_NodeCollectionChanging);
private void EventSink_NodeCollectionChanging(CollectionExEventArgs e)
{
if (e.ChangeType == CollectionExChangeType.Remove)
{
// your code
}
}

e.ChangeType indicates whether the node has been added or node has been deleted. Based on this changetype we can get the Controller.SelectionList before delete.

Let me know if you have any further questions in this regard.

Regards,
Gowri

Stephane Guerillot
Replied On September 10, 2009 11:53 AM

Thanks for your answer.

I didn't use the eventsink handler, but I've found the precog cyborg included in Syncfusion : he raises an event before I press a key on keyboard.

Thank you OnpreviewKeyDown ^^.

Gowri Manohari D [Syncfusion]
Replied On September 11, 2009 02:09 AM

Hi Stephane,

Thank you for your update.

Regards,
Gowri

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;