[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Grids' (#lcl)

# TCustomGrid.Sort

Sorts rows or columns in the grid.

## Declaration

Source position: grids.pas line 1201

`protected procedure TCustomGrid.Sort(`
`ColSorting: Boolean;`
`index: Integer;`
`IndxFrom: Integer;`
`IndxTo: Integer`
`); virtual;`

## Arguments

`ColSorting` |  | True if a column is affected in the method. False if a row is affected.
`index` |  | Column or row number for the values sorted in the method.
`IndxFrom` |  | Position for the first value sorted in the method.
`IndxTo` |  | Position for the last value sorted in the method.

## Description

Sort is a method used to sort items in the grid. When ColSorting is True, it sorts the items in a column. Otherwise, it sorts values in a row. The three index values specify the items to be sorted.