From RAD Studio API Documentation
Jump to: navigation, search


property OnDrawColumnCell: TDrawColumnCellEvent read FOnDrawColumnCell write FOnDrawColumnCell;


__property OnDrawColumnCell;


Type Visibility Source Unit Parent
event published
Vcl.DBGrids TDBGrid


Occurs when the grid needs to paint a cell.

Vcl.DBGrids.TDBGrid.OnDrawColumnCell inherits from Vcl.DBGrids.TCustomDBGrid.OnDrawColumnCell. All content below this line refers to Vcl.DBGrids.TCustomDBGrid.OnDrawColumnCell.

Occurs when the grid needs to paint a cell.

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.

See Also