Sign in Join
FPDoc Onlineexperiment

TCustomStringGrid.Clean procedure

Member of TCustomStringGridpublicIn unit Grids

Removes cell content which match the specified options.

Declaration

pascal
procedure Clean; overload
procedure Clean(CleanOptions: TGridZoneSet); overload
procedure Clean(aRect: TRect; CleanOptions: TGridZoneSet); overload
procedure Clean(StartCol: Integer; StartRow: Integer; EndCol: Integer; 
 EndRow: Integer; CleanOptions: TGridZoneSet); overload

Arguments

CleanOptions

Set with the grid zones affected in the method.

aRect

Rectangle with the bounds for the affected cells.

StartCol

Starting column number for the operation.

StartRow

Starting row number for the operation.

EndCol

Ending column number for the operation.

EndRow

Ending row number for the operation.

Description

Cleans all cells in the grid subject to the given CleanOptions, optionally specifying a range of cells or a rectangular region. See TGridZoneSet for more information.

The cleaning operation does not change the number of rows and columns on the grid control. It replaces the content for the affected cells with empty strings ('').

Some examples:

Clean all cells:

// the same as grid.clean
  grid.Clean([]);

Clean all non-fixed cells:

text

grid.Clean([gzNormal]);

Clean all cells except fixed grid columns:

// leaves cell content in fixed columns
  grid.Clean([gzNormal, gzFixedRows]);

Clean non-fixed cells in a rectangular region:

// 4x3 cell area after fixed columns and rows
  grid.Clean(grid.FixedCols, grid.FixedRows, grid.FixedCols+3, 
    grid.FixedRols+2, [gzNormal]) 

Use Clear to remove all columns and rows on the grid.

Use ColCount, FixedCols, RowCount, and FixedRows to adjust the number of columns or rows for the specific types.

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