RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TColumn.DefaultWidth Method

Returns the default width for the column.

Pascal
function DefaultWidth: Integer;
C++
__fastcall int DefaultWidth();

The value of DefaultWidth is determined as follows: 

If the column has no data grid associated with it, DefaultWidth returns 64. 

If the column has an associated data grid but the Field property is empty, DefaultWidth returns data grid's protected DefaultColWidth property. Usually, this value is 64. 

If the column has an associated data field, DefaultWidth is calculated from the TField object's DisplayWidth property using the column's font. 

If the dgTitles flag is set in the data grid's Options property, DefaultWidth is increased (as necessary) to accommodate the column's title caption. 

 

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