The Basics > Choosing a Column Layout > Automatic layouts |
If you do not define a column layout at design time, True DBGrid will automatically create one based upon the database used when you run your program. All fields from the Data control's Recordset will be displayed, using the field names for column captions. At run time, you can perform database actions that may alter the layout needed to display the data. For example, you may change the DatabaseName, RecordSource, or Recordset properties of the Data control, resulting in a different Recordset. When the new Recordset is created the grid will automatically sense the new column layout and reconfigure. This mode is the most automatic and is quite useful for most applications. You can cancel the grid's automatic layout behavior by invoking the grid's HoldFields method in code.