Skip to content

Processing cCJGrid Data

To process the grid data, you send the message Get DataSource to the datasource object, which will return an array of tDataSourceRow.

The following example demonstrates how to process the entire set of data in the grid's datasource:

tDataSourceRow[] TheDataSource
Handle hoDataSource
Integer iNum iName iStatus
String sNumber sName sStatus

Get phoDataSource of oCustomerGrid to hoDataSource
Get DataSource of hoDataSource to TheDataSource

Move (SizeOfArray(TheDataSource)) to iRows
Get piColumnId of oCustomer_Customer_Number to iNum
Get piColumnId of oCustomer_Name to iName
Get piColumnId of oCustomer_Status to iStatus

For iRow from 0 to (iRows - 1) // for each customer in the grid
    // get customer info from the grid
    Move TheDataSource[iRow].sValue[iNum] to sNumber
    Move TheDataSource[iRow].sValue[iName] to sName
    Move TheDataSource[iRow].sValue[iStatus] to sStatus
    Send DoSomething sNumber sName sStatus
Loop

Grid data can be retrieved and processed at any time. The column and row navigation events can be used to control grid data processing whenever the current cell or row is changed.

See Also