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

# TCustomGrid.SelectedRange

Provides indexed access to TGridRect values in the currently selected range.

## Declaration

Source position: grids.pas line 1378

`public property TCustomGrid.SelectedRange[AIndex: Integer] : TGridRect read GetSelectedRange;`

## Description

SelectedRange is a read-only indexed TGridRect property used to get the cell rectangles in Selections for the grid control. SelectedRange is applicable when multi-select range mode has been enabled in the RangeSelectMode property. Otherwise, the current cell selection at Col and Row is returned as the selected range value.

Use SelectedRangeCount to get the number TGridRect instances in SelectedRange.

Use AddSelectedRange to add the current cell selection to the multi-select range in Selections.

Use ClearSelections to remove the cell rectangles stored in Selections.

## See also

TCustomGrid.RangeSelectMode |  | Controls the range selection mode used for the grid.
TCustomGrid.AddSelectedRange |  | Adds the current range selection to the array of selection rectangles for the control.
TCustomGrid.ClearSelections |  | Clears the current range selection(s) and redraws the grid control.
TCustomGrid.Col |  | Column index for the selected grid cell.
TCustomGrid.Row |  | Row number for the selected grid cell.