Previous Topic

Next Topic

Inhoudsopgave

Book Index

GridDataSet.DisableControls Procedure

Method Method DisableControls

Description

Call DisableControls prior to iterating through a large number of records in the dataset to prevent data-aware controls from updating every time the active record changes. Disabling controls prevents flicker and speeds performance because data do not need to be written to the display.

If controls are not already disabled, DisableControls records the current state of the dataset, broadcasts the state change to all associated data-aware controls and detail datasets, and increments the dataset's disabled count variable. Otherwise, DisableControls just increments the disabled count variable.

The disabled count is used internally to determine whether to display data in data-aware controls. When the disable count variable is greater than zero, data are not updated.

If the dataset is the master of a master/detail relationship, calling DisableControls also disables the master/detail relationship. Setting BlockReadSize instead of calling DisableControls updates the detail datasets as you scroll through the dataset, but does not update data-aware controls.