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.

2

There are 2 answers

1
Holgerwa On

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

1
Marjan Venema On

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: