Recent

Author Topic: problem with dbgrid and tdirectoryedit  (Read 1689 times)

liewald

  • Full Member
  • ***
  • Posts: 142
problem with dbgrid and tdirectoryedit
« on: July 13, 2018, 03:30:56 pm »
Lazarus 1.8.2 r57375 FPC 3.0.4 x86_64-linux-gtk2


Basically what I'm trying to do is overlay  a directoryedit over a field in a dbgrid to allow users to browse to directories and store them in a db. the db is working but I'm having a really weird problem  as soon as I overlay the control it seems as if all the modal returns on the form stop working, this includes other modal forms in the application. Having this problem with all grids so I stared new app dropped a string grid and a directoryedit on it and attached  this code to the drawcell event

procedure TForm1.StringGrid1DrawCell(Sender: TObject; aCol, aRow: Integer;
  aRect: TRect; aState: TGridDrawState);

var val :string;

begin
    with DirectoryEdit1 do
    begin
      Left := aRect.Left + StringGrid1.Left + 2;
      Top := aRect.Top + StringGrid1.Top + 2;
      Width := aRect.Right - aRect.Left;
      Width := aRect.Right - aRect.Left;
      Height := aRect.Bottom - aRect.Top -2;
    end;
end;

messy but basically should put the diredit into the cells . same problem the dialog fires up but the modal buttons on it dont work. if not embedded the diredit works just as expected.

HELP

Dave

 

TinyPortal © 2005-2018