Einzelnen Beitrag anzeigen

bwolf

Registriert seit: 17. Jan 2006
368 Beiträge
 
Delphi 2009 Professional
 
#3

Re: Dbgrid + DoubleClick bzw. RowClick

  Alt 16. Mär 2007, 15:35
Hi Marabu,

thx a lot für die Antwort

Ich habs ein bischen umgebaut, denke mal das es so passt.

Delphi-Quellcode:
procedure Tfrm_sachbearbeiter.dbgrid_uebersichtDblClick(Sender: TObject);
var
  iCol, iRow: Integer;
  pt: TPoint;
begin
  with Sender as TJvDBGrid do
  begin
    pt := ScreenToClient(Mouse.CursorPos);
    MouseToCell(pt.X, pt.Y, iCol, iRow);
    showmessage(inttostr(iCol)+' '+inttostr(iRow));
    if iRow > 0 then DataModule1.ActionList1.Actions[5].Execute;
  end;
end;
Mich würde jetzt noch interessieren, warum es so nicht klappt:
Delphi-Quellcode:
  pt := ScreenToClient(Mouse.CursorPos);
  TJVDbGrid(Sender).MouseToCell(pt.X, pt.Y, iCol, iRow);
  showmessage(inttostr(iCol)+' '+inttostr(iRow));
Danke nochmal, jetzt kann ich bald beruhigt ins Wochenende gehn
  Mit Zitat antworten Zitat