FireDAC.Comp.DataSet.TFDMasterDataLink.DisableDelayedScroll

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure DisableDelayedScroll;

C++

void __fastcall DisableDelayedScroll();

Properties

Type Visibility Source Unit Parent
procedure
function
public
FireDAC.Comp.DataSet.pas
FireDAC.Comp.DataSet.hpp
FireDAC.Comp.DataSet TFDMasterDataLink

Description

Disables the delayed refresh of detail dataset.

Call the DisableDelayedScroll method of the MasterLink property of the detail dataset to disable the delayed refresh of the detail dataset and use immediate refresh instead. The method has effect only if delayed refreshing is in effect. 

The method is useful in an application code, which needs to walk through the master dataset and also read detail the dataset records. Also, the detail dataset has a TFDDataSet object as value. FetchOptions.DetailDelay property value > 0. This allows to combine delayed refreshing of the detail dataset, while the user scrolls through the master dataset in GUI and synchronized refreshing in code. 

To re-enable the delayed refresh of detail dataset, use the EnableDelayedScroll method. The DisableDelayedScroll / EnableDelayedScroll method calls must be in pairs and can be nested. FireDAC uses the counter to track DisableDelayedScroll / EnableDelayedScroll nested calls. The topmost call of the DisableDelayedScroll method synchronizes the detail dataset with the master dataset, if they are out of sync. 

To synchronize the detail dataset with its master dataset once, use the Synchronize method.

Example

qDetail.MasterLink.DisableDelayedScroll;
try
  qMaster.First;
  while not qMaster.Eof do begin
    if qMaster.Fields[i].AsInteger = 100 then begin
      // read qDetail dataset - it is synchronized with qMaster
    end;
    qMaster.Next;
  end;
finally
  qDetail.MasterLink.EnableDelayedScroll;
end;

See Also