RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomDBGrid.DeferLayout Method

Decrements the LayoutLock property and posts a message to the grid to trigger a new layout sequence at a more appropriate time.

Pascal
procedure DeferLayout;
C++
__fastcall DeferLayout();

Applications cannot call this protected method. Data-aware grids call DeferLayout internally to postpone the recomputation of the Columns property after the dataset changes when it is inappropriate to recompute columns immediately. 

DeferLayout calls CancelLayout to decrement the LayoutLock property, which was incremented in response to the change in the dataset. It then posts a message to the grid, which triggers another layout attempt at a later point in time. When the message is received, the grid calls BeginLayout and then either EndLayout or DeferLayout, depending on whether it is an appropriate time to proceed with the computation of Columns

 

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