FireDAC.Comp.DataSet.TFDMasterDataLink.DisableScroll

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure DisableScroll;

C++

void __fastcall DisableScroll(void);

Properties

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

Description

Disables refreshing of a detail dataset.

Call the DisableScroll method of the detail dataset's MasterLink property to disable the refresh of the detail dataset. 

The DisableControls method of the master dataset disables all master dataset "feedback". The DisableScroll method allows you to turn off detail dataset refreshing of a single detail dataset. 

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

Example

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

See Also