TCRDBGrid: OnDrawColumnCell or OnGetCellParams

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
albourgz
Posts: 160
Joined: Wed 06 May 2009 12:17
Location: belgium

TCRDBGrid: OnDrawColumnCell or OnGetCellParams

Post by albourgz » Wed 27 May 2015 11:55

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.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: TCRDBGrid: OnDrawColumnCell or OnGetCellParams

Post by AlexP » Tue 02 Jun 2015 07:47

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.

albourgz
Posts: 160
Joined: Wed 06 May 2009 12:17
Location: belgium

Re: TCRDBGrid: OnDrawColumnCell or OnGetCellParams

Post by albourgz » Tue 02 Jun 2015 08:12

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?

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: TCRDBGrid: OnDrawColumnCell or OnGetCellParams

Post by AlexP » Tue 02 Jun 2015 08:19

The GetCellParams event is called for each drawing.

Post Reply