Skip to main content

TcxCustomDataController.RefreshExternalData Method

Forces a data controller to reload data from a data source.

Declaration

procedure RefreshExternalData; virtual;

Remarks

Call this method to ensure that the data controller contains the latest data for displaying by a bound control. For instance, you can call RefreshExternalData if another application has changed data in the current source of data.

Depending on the data loading mode in effect, the RefreshExternalData method does the following:

  • In unbound and provider modes, calling the RefreshExternalData method does nothing.

  • In server mode, implemented by the TdxServerModeDataController, RefreshExternalData calls the Refresh method of the server mode data source, preserving the focused record position, record bookmark, and the expanded state of data groups.

  • In bound mode, implemented by the TcxDBDataController, RefreshExternalData merely calls the Refresh method of the underlying dataset. Note that the Refresh method does not work for all TDataSet descendants. In particular, query components do not support the Refresh method if the query is not “live”. To refresh a static query, close and reopen the dataset. For huge datasets, data reloading can consume much time. If you need to work with large datasets, you should consider enabling grid mode. In this bound mode, the data controller loads only a fixed number of records at once, thus providing faster loading, reloading, navigating and displaying of records. The data controller normally preserves the focused record, record and selected record bookmarks after data is reloaded from the bound dataset. However, they may not be restored correctly if records were deleted from the dataset by another application.

See Also