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

# TCustomDrawGrid.ColRowExchanged

Performs actions needed when column or row data at the specified positions are exchanged in the grid control.

## Declaration

Source position: grids.pas line 1420

`protected procedure TCustomDrawGrid.ColRowExchanged(`
`IsColumn: Boolean;`
`index: Integer;`
`WithIndex: Integer`
`); override;`

## Arguments

`IsColumn` |  | True if column values are affected. False if row values are affected.
`index` |  | Position for the first column or row swapped in the method.
`WithIndex` |  | Position for the other column or row swapped in the method.

## Description

ColRowExchanged is overridden in TCustomDrawGrid and implements the method defined in the ancestor class. It is used to perform actions needed when column or row values are exchanged (swapped) in the grid control.

IsColumn indicates whether columns or rows are affected in the method. When set to True, column values at the specified positions are exchanged. When set to False, row values are exchanged.

If the Columns property has not been enabled, ColRowExchanged calls the ExchangeColRow method in the internal TVirtualGrid instance for the control.

ColRowExchanged signals the OnColRowExchanged event handler (when assigned).

ColRowExchanged is called from the DoOPExchangeColRow method in the ancestor class.

## See also

TCustomDrawGrid.OnColRowExchanged |  | Event handler signalled when a column or row has been exchanged with another.
TCustomGrid.ColRowExchanged |  | Performs a notification when column or row data at the specified positions are exchanged in the grid control.
TCustomGrid.DoOPExchangeColRow |  | Performs an exchange of values for the columns or rows with the specified indexes.