Calculated Columns
If you do not set any binding table.column in a data-aware grid column (i.e., no Entry_Item command), then the column is considered to be a calculated column. In this case, the OnSetCalculatedValue event is used to create a calculated value for the cell.
Object oOrderDtl_Tax is a cDbCJGridColumn
Set piWidth to 81
Set psCaption to "Tax"
Set pbFocusable to False
Procedure OnSetCalculatedValue String ByRef sValue
Number nTaxRate
Get TaxRate to nTaxRate
Move (OrderDtl.Extended_Price * nTaxRate) to sValue
End_Procedure
End_Object
Normally, a calculated column should be set to be non-focusable (pbFocusable is False).
The calculated column's OnSetCalculatedValue event is called whenever needed to populate a row value for that column. For more information about calculated columns, see OnSetCalculatedValue.