Vcl.DBGrids.TCustomDBGrid.UpdateLock

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property UpdateLock: Byte read FUpdateLock;

C++

__property System::Byte UpdateLock = {read=FUpdateLock, nodefault};

Properties

Type Visibility Source Unit Parent
property protected
Vcl.DbGrids.pas
Vcl.DBGrids.hpp
Vcl.DBGrids TCustomDBGrid

Description

Counts the number of times BeginUpdate is called without a corresponding call to EndUpdate.

UpdateLock prevents the grid from repainting while the data in the grid changes. Whenever a change is made that affects the data that is drawn in the grid, the BeginUpdate method is called. BeginUpdate increments UpdateLock to keep track of the fact that the contents of the grid are changing. When changes are complete, the EndUpdate method is called. EndUpdate decrements UpdateLock.

When UpdateLock returns to 0, the data-aware grid can repaint its cells. When UpdateLock is greater than 0, the grid defers repaints. UpdateLock prevents the grid from flickering when the grid is resized or the user scrolls through the data.

See Also