vcl-cxcustomdata-dot-tcxcustomdatacontroller-dot-foreachrow-x28-system-dot-boolean-cxcustomdata-dot-tcxdatacontrollereachrowproc-x29.md
Calls a custom procedure for each row in a data controller.
procedure ForEachRow(ASelectedRows: Boolean; AProc: TcxDataControllerEachRowProc); virtual;
| Name | Type |
|---|---|
| ASelectedRows | Boolean |
| AProc | TcxDataControllerEachRowProc |
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
TcxCustomDataController.GetSelectedCount
TcxCustomDataController.GetSelectedRowIndex
TcxCustomDataController.MakeRecordVisible
TcxCustomDataController.MultiSelect
TcxCustomDataController.RowCount
TcxDBDataController.GetSelectedBookmark
Example: Changing Selected Records in Bound Mode
Example: Changing Selected Records in Provider and Unbound Modes