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.

dragging while pressing ctrl- key

Thread ID:

Created:

Updated:

Platform:

Replies:

57374 Mar 2,2007 06:59 AM Sep 22,2010 10:30 AM Windows Forms 4
loading
Tags: Diagram
Administrator [Syncfusion]
Asked On March 2, 2007 06:59 AM

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

J.Nagarajan [Syncfusion]
Replied On March 2, 2007 06:51 PM

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.Nagarajan [Syncfusion]
Replied On March 7, 2007 01:29 PM

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

Administrator [Syncfusion]
Replied On September 13, 2010 02:47 PM

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


Pandi Murugan A [Syncfusion]
Replied On September 22, 2010 10:30 AM

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


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.

;