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

# TCustomGrid.LoadFromStream

Loads grid data from the specified stream.

## Declaration

Source position: grids.pas line 1365

`public procedure TCustomGrid.LoadFromStream(`
`AStream: TStream`
`); virtual;`

## Arguments

`AStream` |  | TStream instance with values loaded in the method.

## Description

AStream is the TStream instance with the content loaded in the method. The stream must be positioned at the location where the information for the grid begins. The stream position is not changed after its content has been loaded.

LoadFromStream creates a temporary TXMLConfig instance that is used load the content from the specified stream. The private LoadSub method is called using the configuration file instance to read the content in the file, and may raise an exception if the XML content does not have a valid version element.

LoadFromStream reverses the actions performed in the SaveToStream method. Please note that the SaveOptions property determines the information available to be loaded from the stream.

Use LoadFromFile to read the content in the grid from a file on the local file system.

## See also

TCustomGrid.LoadFromFile |  | Loads grid data from a file with the specified file name.
TCustomGrid.SaveToStream |  | Saves grid information to the specified stream.
TCustomGrid.SaveOptions |  | Options which control the information saved and loaded for the grid control.
TXMLConfig