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

# TValueListEditor.SetRowCount

Sets the value in the RowCount property.

## Declaration

Source position: valedit.pas line 174

`protected procedure TValueListEditor.SetRowCount(`
`AValue: Integer`
`);`

## Arguments

`AValue` |  | New value for the property.

## Description

SetRowCount is an overridden procedure used to set the value in the RowCount property. AValue contains the new value for the property.

AValue cannot contain a value smaller than the number of FixedRows for the grid control. An EGridException exception is raised when AValue is less than the number of FixedRows for the control.

SetRowCount uses the RowCount value inherited from the grid to determine if any actions are required in the method. No actions are performed in the method when the inherited RowCount contains the same value as AValue.

SetRowCount ensures that the Strings property contains the number of entries needed for the new property value minus the FixedRows for the grid. Lines are added to or deleted from Strings until the number of entries matches the needed value.

## Errors

Raises an EGridException exception with the message in rsFixedRowsTooBig when the number of FixedRows is larger than the new value for the property.

## See also

TValueListEditor.RowCount |  | Gets the number of rows for the control.
TValueListEditor.Strings |  | Stores the keys, values, and item definitions in the control.
TCustomDrawGrid.FixedRows |  | Number of the fixed rows in the grid.
TCustomDrawGrid.RowCount |  | Number of rows in the grid.
EGridException |  | Exception raised when an error has occurred in a Grid class.