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

NodeCollectionChanging evt.cancel

Hello
I have a diagram with one node, I want to prevent the following behavior:
When the node is selected, the ctrl key is pressed and we are dragging the node ,it is been copied
What I am doing to prevent this from happening is:
void EventSink_NodeCollectionChanging(CollectionExEventArgs evtArgs)
{
if (Control.ModifierKeys == Keys.Control )
{
evtArgs.Cancel = true ;
}
}
The result is a red cross and an exception
1.why is the evt.cancel not working ;
2.how can I avoid this behavior.

10x Roee






6 Replies

MW Melba Winshia Syncfusion Team February 7, 2008 08:11 AM UTC

Hi Shavit,

Thank you for your interest in Syncfusion Products.

I am afraid that I was not able to reproduce this issue (Red Cross and an exception). Also I have created a simple sample to test this issue and it is available in the below link:

http://websamples.syncfusion.com/samples/Diagram.Windows/F71543/main.htm

Please have a look at the above sample and if still the issue exists, could you please try reproducing it in the above sample and send us the modified sample so that we could sort out the cause of the issue and provide you a solution?

Thanks,
Melba




SR Shavit Roee February 7, 2008 12:34 PM UTC

Hello,
I think that my original message was not clear
I need the cancel event to work meaning that the added Node will be removed from the diagram or i miss understood the evt.cancel =true;
How can i remove the added nOde it

10x again ,



>Hi Shavit,

Thank you for your interest in Syncfusion Products.

I am afraid that I was not able to reproduce this issue (Red Cross and an exception). Also I have created a simple sample to test this issue and it is available in the below link:

http://websamples.syncfusion.com/samples/Diagram.Windows/F71543/main.htm

Please have a look at the above sample and if still the issue exists, could you please try reproducing it in the above sample and send us the modified sample so that we could sort out the cause of the issue and provide you a solution?

Thanks,
Melba






MW Melba Winshia Syncfusion Team February 8, 2008 12:59 PM UTC

Hi Shavit,

Thank you for the update.

Issue: evt.cancel not working

I am able to reproduce this issue. The issue mentioned here is suspected to be a defect and we have sent this to our development team for more analysis. To facilitate tracking the progress of the fix, and timely resolution, we have created an incident #41343 in our incident database Direct Trac.

Please let me know if you have any concerns.

Thanks,
Melba



J. J.Nagarajan Syncfusion Team February 8, 2008 09:39 PM UTC

Hi Shavit ,

If your intention is to prevent the Copy paste functionality while pressing control key and drag the node then you need to prevent the movement of nodes when pressing control key. You need to handle KeyDown and KeyUp event of the diagram control.

The attached sample demonstrates this behavior completely.

http://websamples.syncfusion.com/samples/Diagram.Windows/CloningNodes/main.htm

Please refer to it and let us know if you have any questions.

Please let me know if you have any questions.

Regards,
Nagaraj




SR Shavit Roee February 10, 2008 11:42 AM UTC


Hello ,
I tried to use your solution the only thing is that the problem raises again, when I am selecting 2 Nodes I can "Copy " them using the control key and dragging ,is there any other way I really need to solve this bug .
10x Roee Shavit


>Hi Shavit ,

If your intention is to prevent the Copy paste functionality while pressing control key and drag the node then you need to prevent the movement of nodes when pressing control key. You need to handle KeyDown and KeyUp event of the diagram control.

The attached sample demonstrates this behavior completely.

http://websamples.syncfusion.com/samples/Diagram.Windows/CloningNodes/main.htm

Please refer to it and let us know if you have any questions.

Please let me know if you have any questions.

Regards,
Nagaraj






MW Melba Winshia Syncfusion Team February 12, 2008 05:02 AM UTC

Hi Shavit,

We suspect the issue of evtArgs.cancel not working for NodeCollectionChanging event to be a defect and to facilitate tracking the progress of the fix, and timely resolution, we have created an incident #41343 in our incident database Direct Trac. Please follow this issue in that incident.

Thanks,
Melba




Loader.
Live Chat Icon For mobile
Up arrow icon