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

Thread ID:





23896 Jan 23,2005 04:48 PM Jan 24,2005 03:47 AM Windows Forms 2
Tags: GridControl
Louis Lebrun
Asked On January 23, 2005 04:48 PM

Hi, I want to do some drag & drop operations between two grids. And it''s not allowed to drop everywhere. Where it''s not allowed to drop I''d like to be able to show the drag icon.circle with a line. I tried to listen to DragOver and there to set up DragDropEffects to .none. But I wasn''t successful at all. What could be the simplest way to do that. (If any some sample code will be welcomed.) Louis

Administrator [Syncfusion]
Replied On January 24, 2005 01:55 AM

I think the simplest way to do this is to derive the grid and override OnDragOver.
public class MyGridControl : GridControl
	protected override void OnDragOver(DragEventArgs drgevent)
		base.OnDragOver (drgevent);
		int row, col;
		Point pt = this.PointToClient(new Point(drgevent.X, drgevent.Y));
		if(this.PointToRowCol(pt, out row, out col))
		{//dont drop in col 2
			if(col == 2)
				drgevent.Effect = DragDropEffects.None;

Louis Lebrun
Replied On January 24, 2005 03:47 AM

Thank''s a lot. Louis


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.