Board index » delphi » Drag&Drop with TDBGrid

Drag&Drop with TDBGrid

I want to drag a record from a TDBGrid in one dialog to another dialog. With
a TEdit and OnMouseDown - BeginDrag dragging works fine but from aTDBGrid it
only works when the mouse is clicked in the free area of the grid but what I
want is to click on a recordline in the grid to drag this redord to tha
other dialog but this doesn't work.
What must be done to get it working this way?
Tahnks a lot for helping, Alex.
 

Re:Drag&Drop with TDBGrid


"Alexander G. Otto" <a...@drupa.ch> wrote in message news:3c9dd05e_1@dnews...

Quote
> I want to drag a record from a TDBGrid in one dialog to another dialog. With
> a TEdit and OnMouseDown - BeginDrag dragging works fine but from aTDBGrid it
> only works when the mouse is clicked in the free area of the grid but what I
> want is to click on a recordline in the grid to drag this redord to tha
> other dialog but this doesn't work.
> What must be done to get it working this way?
> Tahnks a lot for helping, Alex.

Create TDBGrid descendant and override it's MouseDown protected method.
There, call inherited one and fire OnMouseDown event.

Re:Drag&Drop with TDBGrid


Hello Alexander,

Link a TtaoDBGrid component (see the link below) to your TDBGrid. The
trial version does not support inter-application transfer, but it supports
the feature you need. Call BeginDrag in the OnBeforeMouseDown event
handler.

--
Andrei Fomine.
DbAltGrid - multi-line layout, RTF and graphics of any kind in DBGrid.
Transfer@once - add full-blown clipboard and drag-and-drop support to any
control.
www.quasidata.com

"Alexander G. Otto" <a...@drupa.ch> wrote in message
news:3c9dd05e_1@dnews...

Quote
> I want to drag a record from a TDBGrid in one dialog to another dialog.
With
> a TEdit and OnMouseDown - BeginDrag dragging works fine but from
aTDBGrid it
> only works when the mouse is clicked in the free area of the grid but
what I
> want is to click on a recordline in the grid to drag this redord to tha
> other dialog but this doesn't work.
> What must be done to get it working this way?
> Tahnks a lot for helping, Alex.

Other Threads