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

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

2 Replies

AD Administrator Syncfusion Team 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;
			}
		}
	}
}


LL Louis Lebrun January 24, 2005 03:47 AM

Thank''s a lot. Louis

Loader.
Live Chat Icon For mobile
Up arrow icon