Sign in Join
FPDoc Onlineexperiment

TCustomGrid.Clear procedure

Member of TCustomGridpublicIn unit Grids

Clears all cells in the grid control.

Declaration

pascal
procedure Clear

Description

Clear is a method used to removed the content in all areas of the grid control.

EditorMode is set to False to remove an active Editor for the grid control.

The ClearRows and ClearCols methods are called to reset the values in the Cols, Rows, FixedCols, and FixedRows properties. If either method returns False, the content had already been cleared and no additional actions are performed in the method.

Clears resets the values in internal members that are used to track the top, left visible cell in the control and the current selection range. Hot-lighted (hovered) cells are also reset in the method.

Clear calls VisualChange to update the cached column and row sizes and redraw the control. SizeChanged is also called to notify event handlers of changes to RowCount or ColCount values.

Compatibility: This applies to Lazarus grids only; under Delphi/Kylix a grid cannot be completely emptied.

Use FixedRows, FixedCols, RowCount, and ColCount to specify the number of rows or columns on the grid.

See also

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