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 06:55 AM UTC

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 08:47 AM UTC

Thank''s a lot. Louis

Loader.
Up arrow icon