RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomDBGrid.DrawCell Method

Draws the cell specified by the ACol and ARow parameters.

Pascal
procedure DrawCell(ACol: Longint; ARow: Longint; ARect: TRect; AState: TGridDrawState); override;
C++
virtual __fastcall DrawCell(Longint ACol, Longint ARow, TRect ARect, TGridDrawState AState);

DrawCell overrides the inherited method to use the Columns property when drawing cells in the grid. 

DrawCell sets up the font and brush and paints the background of the cell. If the DefaultDrawing property is true, DrawCell fetches the data for the cell and writes it to the position described by the ARect parameter. Whether DefaultDrawing is true or false, DrawCell generates the OnDrawDataCell and OnDrawColumnCell events. Finally, if DefaultDrawing is true and either the cell has focus or the cell is selected and Options includes dgAlwaysShowSelection, DrawCell draws a focus rectangle around the cell. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!