Board index » delphi » TDBGrid Drag&Drop

TDBGrid Drag&Drop

Hi!
I use Delphi 3.0.
1) When set DragMode property dmAutomatic:=True then
click on DBGrid don't select record under mouse, but begin
drag immediatly. How can I select record before begin draging?

2) How can I Drag&Drop record in DBGrid to change its place?

Help, please. May be DBGrid is not right component for this purpose? Can
anybode advice something for resolving this problem.

By.
Anatoly.

 

Re:TDBGrid Drag&Drop


*) Set the DragMode to dmManuel
*) In the OnCellEnter event write 'BeginDrag(False);' (look this up in the
helpfile). False means only drag if you move the mouse more than 5 pixels,
with the left mousebutton down!

There is a problem if you use OnMouseDown (you have to make the OnMouseDown
event public first by making a new component derived from TDBGrid), because
it's only working if you're pointing beside a cell, in the the area where
there are no cells. so you have to use the OnCellEnter. There is only one
thing that isnt's so good. You have to have more than one col, and make the
width of the first one := 0. And in Options you must have dgRowSelect :=
true; That's my way oround a anoying problem. I'm sure ther is a better way
but I haven't got the time...Hop you can use this!

----- Oprindelig meddelelse -----
Fra: ??? ??????? <t...@fklan.com.ua>
Nyhedsgrupper: comp.lang.pascal.delphi.databases
Sendt: 12. november 1999 15:16
Emne: TDBGrid Drag&Drop

Quote
> Hi!
> I use Delphi 3.0.
> 1) When set DragMode property dmAutomatic:=True then
> click on DBGrid don't select record under mouse, but begin
> drag immediatly. How can I select record before begin draging?

> 2) How can I Drag&Drop record in DBGrid to change its place?

> Help, please. May be DBGrid is not right component for this purpose? Can
> anybode advice something for resolving this problem.

> By.
> Anatoly.

??? ??????? <t...@fklan.com.ua> skrev i en
nyhedsmeddelelse:80hav4$r...@News.TM.Odessa.UA...

- Show quoted text -

Quote
> Hi!
> I use Delphi 3.0.
> 1) When set DragMode property dmAutomatic:=True then
> click on DBGrid don't select record under mouse, but begin
> drag immediatly. How can I select record before begin draging?

> 2) How can I Drag&Drop record in DBGrid to change its place?

> Help, please. May be DBGrid is not right component for this purpose? Can
> anybode advice something for resolving this problem.

> By.
> Anatoly.

Other Threads