[PATCH] Draw dbgrid header columns/rows when DefaultDrawing false
Original Reporter info from Mantis: BigChimp
-
Reporter name: Reinier Olislagers
Original Reporter info from Mantis: BigChimp
- Reporter name: Reinier Olislagers
Description:
When using DefaultDrawing false and running my own OnDrawColumnCell, fixed/header columns and rows are not drawn (see Windows screenshot).
The patch fixes this issue - tested on Windows and Linux x64.
Based on Ludo Brands' code in the forums:
http://lazarus.freepascal.org/index.php/topic,16300.msg88285.html#msg88285
Thanks.
Steps to reproduce:
Run sample program, import messages.csv. Grid header columns and rows will bleed through and no header text is drawn (see Windows screenshot).
Tested on Windows; on x64 Linux Lazarus r 35878, the bleed through does not happen, but the texts are not drawn in the header rows.
Probable low risk for other widgetsets as the patch only calls already existing DefaultDrawCell...
Additional information:
I've assigned it to the LCL category instead of database as it seems to be a pure drawing bug, not a database-specific item. Don't know if this issue also happens on other grids. Also, dbgrids.pas is in the lcl directory :)
It seems the OnDefaultDrawing event does not fire on header rows/columns.
Delphi XE2 DefaultDrawColumnCell documentation would imply that OnDrawColumnCell is fired for all cells, including header cells.
However, looking at the LCL code - it uses DataCol, it seems it is only intended for data cells (non-header cells).
Perhaps the XE2 documentation is wrong - or I interpreted it incorrectly ;)
Mantis conversion info:
- Mantis ID: 21496
- OS: Windows
- OS Build: Vista
- Build: r 36074 (Windows), 35878 (Linux)
- Platform: x64
- Version: 0.9.31 (SVN)
- Fixed in version: 0.9.31 (SVN)
- Fixed in revision: 36180 (#f431c3e1)
- Target version: 0.99.0