Unit 'Grids' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#lcl]

TCustomGrid.OnDrawCell

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

Declaration

Source position: grids.pas line 1280

protected property TCustomGrid.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, and the drawing state.

OnDrawCell can be used along with the default drawing mechanism for the grid control. Set the DefaultDrawing property to True to allow the grid to render the cell background, state, and focus. Use OnDrawCell to handle the text which appears in the specified cell.

OnDrawCell can be used to render all aspects of a cell by setting DefaultDrawing to False. In this situation, the event handler must handle rendering the background, state, focus, and text 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 when DefaultDrawing is True.

See also

TCustomGrid.DrawCell

  

Draws a cell using a given state at the specified grid location (Col, Row, rectangle).

TCustomGrid.DefaultDrawing

  

Indicates if the default drawing mechanism is used to draw the background for cells.

TCustomGrid.PrepareCanvas

  

Prepares the canvas for drawing the cell at the specified location.

TOnDrawCell

  

Defines the event handler signalled to draw a cell a grid control.