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

dragging while pressing ctrl- key

Hi,

Why when I select several symbols in the diagram with mouse using Ctrl key and then drag these symbols to another location still holding Ctrl-key, selected symbols are copied. Is it by design?
If so, how can I deny this copying?I just want to move symbols regardless Ctrl-key

4 Replies

J. J.Nagarajan Syncfusion Team March 2, 2007 11:51 PM UTC

Hi Ok,

This is Diagram's intented behaviour . We are currently analysing this behaviour. We will update you on Monday regarding this issue. We sincerely apologize for this time delay.

Thanks,
Nagaraj


J. J.Nagarajan Syncfusion Team March 7, 2007 06:29 PM UTC

Hi Ok,

Sorry for the delay in getting back to you. You have to implement an override for the System.ICloneable.Clone() method and return the current symbol to prevent the Copy- Paste action.

The following code shows the Clone() implementation for your requirement,

public class MySymbol:Symbol
{
public MySymbol()
{
}
public override object Clone()
{
return this;
}
}

I have attached the sample that demonstrates this completely. I hope this will meet your requirement.

You can download this sample from the following page

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

Please refer to this sample and let me know if you have any questions.

Thanks for using Syncfusion product.

Regards,
Nagaraj


AD Administrator Syncfusion Team September 13, 2010 06:47 PM UTC

Hello,

In attempting to upgrade to the latest version I have to solve a lot of problems, for example with the Clone overriding, as it was suggested in this thread.

Current version gives very interesting result of this. While I'm clicking on diagram symbol, it dissapeares slowly. After a long investigation, I understood that the reason is this Clone method override. Symbol select calls Clone and it changes opacity of the symbol, and does not change it back.

So, I've deleted this Clone override, but the question returns. What is the method to prevent symbol copying during drag with Ctrl-key pressed..

Regards



PM Pandi Murugan A Syncfusion Team September 22, 2010 02:30 PM UTC

Hi,

Thank you for your interest in Syncfusion Products.

We suggest you to use NodeCollectionChanging Event and add the following logic(code snippet)in this event to achieve your requirement.

Please refer the below code snippet.


[C#]
if (evtArgs.ChangeType == CollectionExChangeType.Insert)
{
if (Control.ModifierKeys == Keys.Control)
{
if (evtArgs.Element != null)
{
evtArgs.Cancel = true;
}
}
}

We have created a simple sample for demonstrate this and the same can be downloaded from the below link.

PasteNodeCtrlDrag157360070.zip

Please let me know if you have any concerns.

Regards,
Pandi Murugan A


Loader.
Live Chat Icon For mobile
Up arrow icon