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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Drag & Drop

Thread ID:





23896 Jan 23,2005 09:48 PM UTC Jan 24,2005 08:47 AM UTC WinForms 2
Tags: GridControl
Louis Lebrun
Asked On January 23, 2005 09:48 PM UTC

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 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;

Louis Lebrun
Replied On January 24, 2005 08:47 AM UTC

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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon