RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomDBGrid.UpdateLock Property

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

Pascal
property UpdateLock: Byte;
C++
__property Byte UpdateLock;

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. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!