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

# TCustomStringGrid.Modified

Indicates whether the content in the grid cells has been changed.

## Declaration

Source position: grids.pas line 1797

`protected property TCustomStringGrid.Modified : Boolean read FModified write FModified;`

## Description

Modified is a Boolean property which indicates whether the cell content in the grid control has been changed. Modified is set to True when the Cells property is updated and the SetCells method is called to apply the new value. This occurs when a cell is edited using a built-in cell editor, or when a value is directly assigned to the Cells property.

Modified is set to False when the control is Loaded using the LCL streaming mechanism.

Methods which use Cells to indirectly assign value(s) also set Modified to True. These include: AssignTo, SelectionSetText, SelectionSetHTML, SetCheckBoxState, SetEditText, LoadContent, Clean, InsertRowWithValues, LoadContent, LoadFromFile, LoadFromStream, LoadFromCSVFile and LoadFromCSVStream.

In contrast, methods which perform row or column operations without changing Cells do not cause the Modified property to be set. These are generally methods from an ancestor class where Modified does not exist, and include: ClearCols, ClearRows, DeleteColRow, DeleteCol, DeleteRow, ExchangeColRow, InsertColRow, MoveColRow, SortColRow, DoOPDeleteColRow, DoOPExchangeColRow, DoOPInsertColRow, and DoOPMoveColRow.

The event handlers signalled from these methods can be used to update the value in Modified, including: OnColRowDeleted, OnColRowExchanged, OnColRowInserted, OnColRowMoved, and OnCompareCells. Or, as an alternative, update Modified from an event handler like OnClick assigned to the control which triggers one of these operations.

Methods which save the grid content do not reset the value in Modified when the operation is completed. These include: SaveContent, SaveToFile, SaveToCSVFile, SaveToStream, and SaveToCSVStream. These actions are triggered by a control in the application, and its OnClick or OnExecute handler can be used to set the value in Modified.

## See also

TCustomStringGrid.Cells |  | Provides indexed access to a cell value by its column and row number.
TCustomStringGrid.SetCells |  | Sets the value for the indexed Cells property.