Recent

Author Topic: error in dbgrid painting when using DrawCell event  (Read 997 times)

tester-dev

  • New member
  • *
  • Posts: 9
error in dbgrid painting when using DrawCell event
« on: October 12, 2020, 01:04:46 pm »
Bonjour. I am using kdbgrid from KControls for lazarus. 1- When i add this :

Code: Pascal  [Select][+][-]
  1. procedure TForm1.KDBGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
  2.   R: TRect; State: TKGridDrawState);
  3.  
  4. begin
  5.     if (aCol <> 1) or (aRow = 0) then begin
  6.         Exit;
  7.     end;
  8.       if (aCol=2) and (aRow > 1) then begin
  9.         KDBGrid1.CellRect(aCol, ARow,R);
  10.         R.Left := R.Right - (R.Bottom - R.Top);
  11.         Button3.BoundsRect := R;
  12.         KDBGrid1.Editor.Assign(Button3);
  13.       end;
  14. end

my dbgrid does't show correctly.

so i can't add any buttons to the cells of the grid or images in a permanent way. I read the help (kgrid_manual.pdf) but i didn't find any thin.

thanks a lot .
« Last Edit: October 12, 2020, 06:41:36 pm by tester-dev »

 

TinyPortal © 2005-2018