Skip to content

DestroyColumnObjects - cCJGrid

Destroys all column objects

Type: Procedure

Syntax

Procedure DestroyColumnObjects

Call Example

Send DestroyColumnObjects

Description

DestroyColumnObjects destroys all column objects, both the DataFlex object and its COM counterpart. There is no need to send this during a normal Grid destroy process.

You'd only use this if you were dynamically creating columns. This might be used if you need to completely reconfigure a grid while it is active. In such a case, you must destroy all existing columns using DestroyColumnObjects, dynamically create new column objects and initialize them by sending CreateColumns and then refill your grid. This is a rather advanced technique and should be rarely needed. The code to do this might look something like this:

// Destroy existing columns and reset datasource
Send DestroyColumnObjects
// you'd have to write this method yourself
Send CreateNewColumnsForThisGrid
// Initializes columns. Creates the COM column objects and binds
// them  to the grid and datasource
Send CreateColumns
// refill the grid with data. You'd have to write this method yourself
Send LoadGridWithNewData

There is no option to destroy individual columns - just destroy them all and start over. Sending this message resets the datasource. The datasource is not valid when the column objects are destroyed.