Data.DB.TDataSet.ControlsDisabled

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function  ControlsDisabled: Boolean; inline;

C++

bool __fastcall ControlsDisabled();

Properties

Type Visibility Source Unit Parent
function public
Data.DB.pas
Data.DB.hpp
Data.DB TDataSet

Description

Indicates whether data-aware controls update their display to reflect changes to the dataset.

Call ControlsDisabled to ascertain whether the updating of data display in data-aware controls is currently disabled. If ControlsDisabled is true, controls are currently disabled. ControlsDisabled is true as long as the reference count that keeps track of disabling for the dataset is greater than zero. This count is incremented every time the DisableControls method is called and decremented when EnableControls is called. Applications call DisableControls to improve performance and prevent constant updates during automated iterations through records in the dataset.

In complex applications, when controls may be disabled multiple times by different processes, you can use ControlsDisabled as a check in a procedure to reenable controls should each call to DisableControls not be paired with a subsequent call to EnableControls. For example,



procedure ReEnableControls (DataSet: TDataSet);
begin
while DataSet.ControlsDisabled do
DataSet.EnableControls;
end;



void __fastcall TForm1::ReEnableControls(TDataSet *DataSet)
{
while (DataSet->ControlsDisabled())
DataSet->EnableControls();
}



See Also