RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomDBGrid.BeginLayout Method

Increments the LayoutLock property when the column bindings or fields in the dataset change.

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

Applications cannot call this protected method. Data-aware grids call BeginLayout internally before making changes to the Columns property or any of the individual TColumn objects in Columns. Once the change is complete, the data-aware grid calls EndLayout. If the response to the change must be canceled or postponed, the grid calls CancelLayout

Each call to BeginLayout increments the LayoutLock property. Each call to EndLayout or CancelLayout decrements the LayoutLock property. If LayoutLock returns to 0 in a call to EndLayout, the Fields property is updated to match both the bindings of the Columns property and the fields available in the dataset. The Columns property is then updated in turn to match the Fields property. This ensures that the Columns property matches both the specified column bindings and the fields available in the dataset. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!