Sign in Join
FPDoc Onlineexperiment

TCustomGrid.DoOPDeleteColRow procedure

Member of TCustomGridprotectedIn unit Grids

Performs a delete operation for a column or a row.

Declaration

pascal
procedure DoOPDeleteColRow(IsColumn: Boolean; index: Integer)

Arguments

IsColumnTrue if Index refers to a column instead of a row.
index

Position for the column or row deleted in the method.

Description

DoOPDeleteColRow is a method which performs actions needed to delete the specified column or row from the grid control.

IsColumn indicates whether a column or row is affected in the method. When set to True, the specified column number is deleted from the control. Otherwise, the specified row number is removed.

Use Index to specify the position for the column or row removed in the method.

Prior to removing the specified column or row, private methods are called to validate values used by or affected in the operation like:

Index
Checks whether the value in Index is a valid column or row number. An EGridException exception is raised if Index has an invalid index value for the grid control.
FixedCols, FixedRows
Ensures that new fixed column or row counts are valid for the number of columns or rows on the grid control. An EGridException is raised if the new values are not within the limits for the column or row count.
Col, Row, ColCount, RowCount
Ensures that values for Col or Row are range limited to the new column or row count for the control. Calls MoveNextSelectable to scroll the grid control to the new origin cell when needed.

DoOPDeleteColRow ensures that a visible cell editor in the column or row is deactivated by setting EditorMode to False.

The ColRowDeleted method is called when the affected data has been removed from the grid control and the cached values in GCache. In a descendent class (TCustomDrawGrid), the OnColRowDeleted event handler is signalled (when assigned).

Col and Row are updated if the operation causes the selection range to be changed, and SelectCell is called to include the cell in Selection. Sizes for auto-filled columns are recalculated when needed. The cell Editor is updated when needed for the new selection and position on the grid control.

See also

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