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

Drag&Drop: AllowedEffects

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


1 Reply

AD Administrator Syncfusion Team March 26, 2008 09:00 PM UTC

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



Loader.
Live Chat Icon For mobile
Up arrow icon