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.

Databound Grid DragDrop Problem

Thread ID:

Created:

Updated:

Platform:

Replies:

14393 May 26,2004 07:33 AM May 26,2004 07:05 PM Windows Forms 4
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On May 26, 2004 07:33 AM

I tried to do a drag drop from GDBG1 to GDBG2 on a MDI form. However, the GDBG2''s DragDrop event never get fire. On the other hand, the GDBG2''s DragEnter event does fire properly. What should I do in order to get the DragDrop event working? I already set both grids'' AllowDrop = true. Please advise. Thanks.

Administrator [Syncfusion]
Replied On May 26, 2004 08:12 AM

What version of our libraries are you using? In earlier version, the default windows forms DragDrop support was trumped (meaning the grid would handle the standard events and not forward them onto other listeners) by the grid''s own default OLE D&D support. But this was fixed pretty earlier. Certainly 1.6.1.8 and later should not have this problem. Here is a sample that drags & drops between grid''s on an MDI child forms, and the DragDrop event is fired for version 2.0.5.1. What are you doing differently? MDI_2511.zip

Administrator [Syncfusion]
Replied On May 26, 2004 02:08 PM

Thanks for the sample, it helps. I am using the latest version of the libraries. I now have an inherited GDBG control which override the OnDragDrop method. This override method does not call the base class OnDragDrop in order to bypass the default drag drop behavior. My problem is that the DragDrop event never get fire in the Form. What should I do in my override OnDragDrop method in order to fire the DragDrop event back to the Form. Thanks in advance. >What version of our libraries are you using? > >In earlier version, the default windows forms DragDrop support was trumped (meaning the grid would handle the standard events and not forward them onto other listeners) by the grid''s own default OLE D&D support. > >But this was fixed pretty earlier. Certainly 1.6.1.8 and later should not have this problem. > >Here is a sample that drags & drops between grid''s on an MDI child forms, and the DragDrop event is fired for version 2.0.5.1. What are you doing differently? > >MDI_2511.zip > >

Administrator [Syncfusion]
Replied On May 26, 2004 03:01 PM

The DragDrop event can only be raised in the baseclass. So, you not calling the baseclass is why the event is not raised. One thing you could do is to add your own event, and then raised that event in your override. Then the form would subscribe to your event, and not the baseclass event that does not get raised.
public class MyGridDataBoundGrid : GridDataBoundGrid
{
	public event DragEventHandler MyDragDrop;
	
	protected override void OnDragDrop(DragEventArgs drgevent)
	{
		// TODO:  Add MyGridDataBoundGrid.OnDragDrop implementation
		//base.OnDragDrop (drgevent);
		if(this.MyDragDrop != null)
			this.MyDragDrop(this, drgevent);
	}
}
If you are programmoing in VB, you might be able to avoid this extra by trying RaiseEvent to see if that will work in your override. (I did not try to do it...)

Administrator [Syncfusion]
Replied On May 26, 2004 07:05 PM

Thanks again for your excellent support! >The DragDrop event can only be raised in the baseclass. So, you not calling the baseclass is why the event is not raised. > >One thing you could do is to add your own event, and then raised that event in your override. Then the form would subscribe to your event, and not the baseclass event that does not get raised. >
>public class MyGridDataBoundGrid : GridDataBoundGrid
>{
>	public event DragEventHandler MyDragDrop;
>	
>	protected override void OnDragDrop(DragEventArgs drgevent)
>	{
>		// TODO:  Add MyGridDataBoundGrid.OnDragDrop implementation
>		//base.OnDragDrop (drgevent);
>		if(this.MyDragDrop != null)
>			this.MyDragDrop(this, drgevent);
>	}
>}
>
> >If you are programmoing in VB, you might be able to avoid this extra by trying RaiseEvent to see if that will work in your override. (I did not try to do it...)

CONFIRMATION

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.

;