Board index » delphi » Detecting mouse position in TDBGrid

Detecting mouse position in TDBGrid

Hi again, folks...

Well, I managed finally to publish OnMouseDown for my
TExtendedDBGrid and now I can start drag'n'drop just fine.

But when I want to drop the cell contents on another DBGrid,
I need to find out onto which cell user did end the drop.

I found, that there is a MouseCoord(x,y), which should
tell me the cell where user finished the drop. But
when I do:

procedure TfrmWorkList.dbgMyDBListDragDrop(Sender, Source:
          TObject; X,Y: Integer);
var
   droppedcell  : TGridCoord;

begin
     if (Sender is TDBGrid) and (Source is TExtendedDBGrid) then
     begin
          droppedcell:=dbgMyDBList.MouseCoord(x,y);
     end;
end;

Delphi complaines that "Field identifier expected" or something
like that on MouseCoord (on compiling)... Now, I understood that
TDBGrid is derived from TCustomDBGrid which is derived from
TCustomGrid, which defines MouseCoord. At least I confirmed that
with Object Browser and it showed MouseCoord under TDBGrid...

Why can't TDBGrid see MouseCoord????

Any advice? If I can't use MouseCoord, how else am I
supposed to find out the cell, where user ended the drop???

Peace,
      Petri

 

Re:Detecting mouse position in TDBGrid


Quote
In article <3ttgj7$...@idefix.eunet.fi>, petrijr@sik (Petri Riipinen) wrote:
>But when I want to drop the cell contents on another DBGrid,
>I need to find out onto which cell user did end the drop.

>I found, that there is a MouseCoord(x,y), which should
..
>Delphi complaines that "Field identifier expected" or something
>like that on MouseCoord (on compiling)...

MouseCoord is protected.

Other Threads