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
- Double-click the grid to display the Columns editor.
- Select the field to remove in the Columns list box.
- 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:
delete DBGrid1->Columns->Items[5];