Sign in Join
FPDoc Onlineexperiment

TCustomGrid.OnDrawCell property

Member of TCustomGridprotectedIn unit Grids

Event handler signalled to draw a cell in the grid control.

Declaration

pascal
property OnDrawCell: TOnDrawCell read FOnDrawCell write FOnDrawCell;

Description

OnDrawCell is a TOnDrawCell property with the event handler signalled to render a cell in the grid control. Parameters passed to the event handler identify the column and row numbers for the cell, the drawing rectangle, and the grid draw state for the cell.

OnDrawCell can be used to perform drawing operations which supplement or override the default drawing mechanism in the grid control. When DefaultDrawing property is True, the DefaultDrawCell method is called to render the cell background, state, text and focus in the default manner. Use OnDrawCell to perform drawing actions which differ from the default for the specified cell.

OnDrawCell can be used to render all aspects of a cell when DefaultDrawing is set to False. In this situation, the event handler must handle rendering the background, state, text, and focus for the cell.

OnDrawCell is signalled (when assigned) from the DrawCell method at run-time. It is not signalled at design-time. OnDrawCell occurs after the canvas has been configured using PrepareCanvas, and after DefaultDrawCell has been called (when DefaultDrawing is True).

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.