Skip to main content

TcxCustomDataController.LoadFromStream(TStream) Method

Populates your data controller with data from a stream.

Declaration

procedure LoadFromStream(AStream: TStream);

Parameters

Name Type
AStream TStream

Remarks

The LoadFromStream method allows you to restore data (record count and field values) from a stream previously stored by the SaveToStream method. This method replaces the existing data in the data controller.

LoadFromStream and SaveToStream can be used only in unbound mode.

The AStream parameter represents a TStream descendant from which data is loaded.

The number of items in the current data controller and in the stream must be identical. Also, the data controller validates the data types of the values being loaded from the stream. These values must match the data types of items in the current data controller. If these checks fail, loading from the stream stops and the EcxInvalidDataControllerOperation exception with the message “Invalid stream format” is raised.

After checking stream validity, the method assigns the appropriate value to the RecordCount property and loads values for records and items.

See Also