RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomDBGrid.DefaultDrawDataCell Method

Draws the text in a column cell.

Pascal
procedure DefaultDrawDataCell(const Rect: TRect; Field: TField; State: TGridDrawState);
C++
__fastcall DefaultDrawDataCell(const TRect Rect, TField Field, TGridDrawState State);

Call DefaultDrawDataCell from an OnDrawDataCell event handler to lookup up the text representation of a field and write it to the cell. Unlike what the grid draws when the DefaultDrawing property is true, DefaultDrawDataCell gets the alignment for the text from the field component rather than the column descriptor, and it never draws a focus rectangle on selected cells. 

The Rect parameter gives the position of the cell on the canvas. The Field parameter gives the field component that provides the data and alignment for the cell. The State parameter indicates whether the cell has input focus, whether the cell is selected, and whether the cell is a fixed (non-data) cell such as a column header. 

 

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