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.

Delete node with confirmation

Thread ID:

Created:

Updated:

Platform:

Replies:

79232 Jan 26,2009 08:21 AM Feb 10,2009 06:22 PM Windows Forms 2
loading
Tags: Diagram
bgener
Asked On January 26, 2009 08:21 AM

Hi,

Is there any possibility to display confirmation box when user attempts to delete the node from the diagram (by pressing the key "Delete"). I'm trying to accomplish it in the following way:
void EventSink_NodeCollectionChanging(CollectionExEventArgs evtArgs)
{
if (evtArgs.ChangeType == CollectionExChangeType.Remove)
{
DialogResult dialogResult = MessageBox.Show(""...);

}
}

The main issue is when I'm trying to delete multiple items then the message box is displayed for each node which is being deleted. E.g. if I'm trying to delete 100 nodes this messagebox will be displayed 1000 times.

From other hands the following approach does not work too:

private void diagram1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Delete)
{
DialogResult dialogResult = MessageBox.Show(...);
}
}

Because the event is raised after the node was deleted (that is, after the events NodeCollectionChanging and NodeCollectionChanged)

Could you please help me to find possible solution?

Best regards,
Borys


Ajeet M [Syncfusion]
Replied On February 2, 2009 04:09 AM

Hi bgener,

As per the official policy, we will not be able to post the details about feature or defect fix and custom build information in public forums. We have noticed that you have an account in Direct Trac and you can use it to create a new incident, to which we could provide you the more appropriate details.

Let me know if you shall need any further clarifications in this regard.

Regards,
Ajeet



Eric Robishaw
Replied On February 10, 2009 06:22 PM

At the start of NodeCollectionChanging ask the user if they want to delete the node and add an "Do the same for all nodes" option check box.
Then, you apply the same logic to each changing event.


>Hi,

Is there any possibility to display confirmation box when user attempts to delete the node from the diagram (by pressing the key "Delete"). I'm trying to accomplish it in the following way:
void EventSink_NodeCollectionChanging(CollectionExEventArgs evtArgs)
{
if (evtArgs.ChangeType == CollectionExChangeType.Remove)
{
DialogResult dialogResult = MessageBox.Show(""...);

}
}

The main issue is when I'm trying to delete multiple items then the message box is displayed for each node which is being deleted. E.g. if I'm trying to delete 100 nodes this messagebox will be displayed 1000 times.

From other hands the following approach does not work too:

private void diagram1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Delete)
{
DialogResult dialogResult = MessageBox.Show(...);
}
}

Because the event is raised after the node was deleted (that is, after the events NodeCollectionChanging and NodeCollectionChanged)

Could you please help me to find possible solution?

Best regards,
Borys




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.

;