TCustomStringGrid.DoCompareCells function
Performs a comparison between the specified cells in the grid control.
Declaration
function DoCompareCells(Acol: Integer; ARow: Integer; Bcol: Integer;
BRow: Integer): Integer; overrideArguments
Acol | Column number for the first cell value in the comparison. |
ARow | Row number for the first cell value in the comparison. |
Bcol | Column number for the second cell value in the comparison. |
BRow | Row number for the second cell value in the comparison. |
Function result
Relative sort order for the compared cell values.
Description
DoCompareCells is an overridden method used to compare cell
values in the Sort method. It calls the inherited method when the
OnCompareCells event handler has been assigned. The return value from the
event handler contains the relative sort order for the compared cells, and
uses the following values:
- -1
- The cell at ACol and ARow occurs comes before the cell at BCol and BRow.
- 0
- The specified cells have the same value.
- 1
- The cell at ACol and ARow occurs comes after the cell at BCol and BRow.
When OnCompareCells is not assigned, the AnsiCompareText
routine is called to perform the cell comparison and provide the return
value for the method. When SortOrder is set to soDescending, the return
value is negated.
See also
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
