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.

Drag&Drop: AllowedEffects

Thread ID:

Created:

Updated:

Platform:

Replies:

72131 Mar 4,2008 08:19 AM Mar 26,2008 05:00 PM Windows Forms 1
loading
Tags: GridControl
AndreasG
Asked On March 4, 2008 08:19 AM

Hi everybody,

I need to Drag&Drop inside a grid (not inbetween different controls).

I've implemented the DragEnter, DragOver and DragDrop event handlers.

In general, that works. But I now should define at the start of the dragging, which operation (move, copy or both or none) should be allowed.

Setting e.Effect in DragEnter does not set the allowed effect, as I noticed. Where and how do I have to set the allowed effects?

Best regards
Andreas


Administrator [Syncfusion]
Replied On March 26, 2008 05:00 PM

Hi Andreas,

You can set the DragDropEffects in DragOver event like below code snippet

private void gridControl1_DragOver(object sender, System.Windows.Forms.DragEventArgs e)
{
e.Effect = DragDropEffects.Copy;
System.Diagnostics.Debug.WriteLine(string.Format("gridControl1_DragOver: AllowedEffect = {0}, Effect = {1}", e.AllowedEffect, e.Effect));
}

Please refer the attached sample and let me know this helps.
http://websamples.syncfusion.com/Samples/Grid.Windows/F72131/main.htm



Best regards,
Johnson



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.

;