1

I have a TcxGridDBTableView in a window, and dragmode is set to dmAutomatic. When I drag and drop a row above another, it works fine. But when i drag and drop a row to the outside of the window, I'm not getting to the TcxGridDBTableView's 'OnEndDrag' event.

Ex.:

procedure TfrmMyForm.cxGridDBTableViewEndDrag(Sender, Target: TObject; X, Y: Integer);
begin
  ShowMessage('ClassName: ' + Sender.ClassName );
end;

I'm debuggin it, and i have a breakpoint at the showmessage line, but when i drop a row outside of the window, the program dont stop at the line.

I'm using the express quantum grid to implement that.

RRUZ
  • 134,889
  • 20
  • 356
  • 483
Haruki
  • 674
  • 1
  • 9
  • 24

2 Answers2

0

Drag / drop to another application (I assume you mean that by "outside of the windows") is not trivial.
The best solution I found is the DragDrop Component Suite of Anders Melander:
http://melander.dk/delphi/dragdrop

Holgerwa
  • 3,430
  • 9
  • 42
  • 50
  • I appreciate the answers. But perhaps my problem is simpler than it appears to be. I just need a flag that notify me if the drag-n-drop has been done successfully. Because i need to undone the changes I make when i start to drag when the 'drop' has not been accepted, for exemple, in the case i drag a row to the outside of the windows application. Sorry for my bad english. – Haruki Aug 03 '10 at 12:18
0

Assuming that by "window" you mean the application window, that is because the drag-n-drop implemented by controls is for drag-n-drop within an application only. For drag-n-drop from one application to another, you need to use OLE drag-n-drop. Either implemented yourself (it isn't too hard), or by using a library.

MSDN documentation on OLE drag-n-drop is pretty good. Starting point for reading: Data Transfer (COM)

Two libraries I am aware of:

Marjan Venema
  • 19,136
  • 6
  • 65
  • 79
  • I appreciate the answers. But perhaps my problem is simpler than it appears to be. I just need a flag that notify me if the drag-n-drop has been done successfully. Because i need to undone the changes I make when i start to drag when the 'drop' has not been accepted, for exemple, in the case i drag a row to the outside of the windows application. Sorry for my bad english. – Haruki Aug 03 '10 at 12:17