Skip to main content

TcxCustomDataController.SaveKeys Method

Saves the record identifiers of the expanded master rows, grouping rows and selected rows.

Declaration

procedure SaveKeys;

Remarks

Use the SaveKeys method to save the record identifiers of the master rows, grouping rows and selected rows. Unlike record handles and record indexes, record identifiers are not changed when the number and order of records within a dataset changes (see the TcxCustomDataSource class description for information on record indexes and record handles).

The record identifiers are generated via the GetRecordId method which accepts record handles as its parameter.

Call the SaveKeys method before making changes to a dataset (for instance, before deleting a record). This will keep the expansion and selection state within the data controller when changing the order of records within the associated dataset. Call the RestoreKeys method to restore the record state, saved via the SaveKeys method.

See Also