Page 1 of 1
TCRDBGrid: OnDrawColumnCell or OnGetCellParams
Posted: Wed 27 May 2015 11:55
by albourgz
Hi,
both events OnDrawColumnCelml and OnGetCellParams seem to get the same parameters.
I would kike to know what is the aim of the OnGetCellParams Event? Is it supposed to be faster? Or called only once for each cell?
Regards.
Re: TCRDBGrid: OnDrawColumnCell or OnGetCellParams
Posted: Tue 02 Jun 2015 07:47
by AlexP
Hello,
DrawColumnCell is an event of the standard DBGrid, GetCellParams is an event of our CRDBGrid. These events have different parameters:
TDrawColumnCellEvent = procedure (Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState) of object;
TGetCellParamsEvent = procedure (Sender: TObject; Field: TField; AFont: TFont; var Background: TColor; State: TGridDrawState; StateEx: TGridDrawStateEx) of object;
The GetCellParams event is called for each grid cell.
Re: TCRDBGrid: OnDrawColumnCell or OnGetCellParams
Posted: Tue 02 Jun 2015 08:12
by albourgz
Yes, but DrawColumnCell is also called for each cell, and even more, for each drawing of the cell.
Is your GetCellParams called also at each drawing of the cell? Or only once?
Re: TCRDBGrid: OnDrawColumnCell or OnGetCellParams
Posted: Tue 02 Jun 2015 08:19
by AlexP
The GetCellParams event is called for each drawing.