RAD Studio |  |

Deleting Persistent Columns
See Also
Collapse All

Deleting a persistent column from a grid is useful for eliminating fields that you do not want to display.

To remove a persistent column from a grid

1. Double-click the grid to display the Columns editor.
2. Select the field to remove in the Columns list box.
3. Click Delete (you can also use the context menu or Del key, to remove a column).

Note: If you delete all the columns from a grid, the Columns.State property reverts to its csDefault state and automatically build dynamic columns for each field in the dataset.
You can delete a persistent column at runtime by simply freeing the column object:
Copy Code

    DBGrid1.Columns[5].Free;

Copy Code

    delete DBGrid1->Columns->Items[5];

See Also

Creating Persistent Columns

Arranging the Order of Persistent Columns

Defining a Lookup List Column

Putting a Button in a Column

Setting Column Properties at Design Time

Restoring Default Values to a Column

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