Skip to main content

TcxCustomDataController.ForEachRow(Boolean,TcxDataControllerEachRowProc) Method

Calls a custom procedure for each row in a data controller.

Declaration

procedure ForEachRow(ASelectedRows: Boolean; AProc: TcxDataControllerEachRowProc); virtual;

Parameters

Name Type
ASelectedRows Boolean
AProc TcxDataControllerEachRowProc

Remarks

Call this method to iterate selected or all rows available in your data controller. Call a custom procedure (callback function) for each row. The ASelectedRows parameter specifies whether to process selected or all rows. The callback function is passed as the AProc parameter. The function prototype is determined by the TcxDataControllerEachRowProc type.

The ForEachRow method can be used in all loading modes (unbound, provider, bound, grid, and server modes). When iterating rows in grid mode, the ForEachRow method focuses a row and then calls the specified callback function. In other modes, focus is not affected by ForEachRow.

Use the RowCount property to determine the total number of rows. It takes into account data records and grouping rows which are visible or potentially visible by scrolling (i.e. not hidden in a collapsed group). You can use the MakeRecordVisible method first to make a particular record visible if it is hidden within a collapsed group.

See Also