RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomDBGrid.OnDrawColumnCell Event

Occurs when the grid needs to paint a cell.

Pascal
property OnDrawColumnCell: TDrawColumnCellEvent;
C++
__property TDrawColumnCellEvent OnDrawColumnCell;

Write an OnDrawColumnCell event handler to provide customized drawing for the data in the cells of the grid. Draw on the cell using the methods of the Canvas property. 

An OnDrawColumnCell event handler can call the DefaultDrawColumnCell method to instruct the data-aware grid to write the data value in the cell. The OnDrawColumnCell event handler can augment the DefaultDrawColumnCell method to provide visual indications of selection and focus. 

If DefaultDrawing is true, the data will already be drawn in the cell before the OnDrawColumnCell event, and the grid draws a focus rectangle around selected cells after the OnDrawColumnCell event.

Note: If the Columns property has a State property of csDefault, the OnDrawDataCell event occurs before the OnDrawColumnCell. The OnDrawDataCell event is obsolete, and only included for backward compatibility. Do not set both an OnDrawDataCell event handler and an OnDrawColumnCell event handler.
 

 

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