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

TCustomGrid.LoadFromFile

Loads grid data from a file with the specified file name.

Declaration

Source position: grids.pas line 1364

public procedure TCustomGrid.LoadFromFile(

  FileName: string

); virtual;

Arguments

FileName

  

Name of the file with the content loaded in the method.

Description

FileName contains name of the file with the content loaded in the method, and may included a fully qualified path. An Exception is raised with the message in rsGridFileDoesNotExist if a file with the specified path and name is not found.

LoadFromFile creates a temporary TXMLConfig instance that is used load the content from the specified file. 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.

LoadFromFile reverses the actions performed in the SaveToFile method. Please note that the SaveOptions property determines the information available to be loaded from the file.

Use LoadFromStream to read the content in the grid from a TStream instance.

See also

TCustomGrid.LoadFromStream

  

Loads grid data from the specified stream.

TCustomGrid.SaveToFile

  

Saves grid information to a file with the specified name.

TCustomGrid.SaveOptions

  

Options which control the information saved and loaded for the grid control.

TXMLConfig


Version 4.0 Generated 2025-05-03 Home