Skip to main content

TcxCustomDataController.FilteredRecordCount Property

Returns the number of records that meet the active filter criteria.

Declaration

property FilteredRecordCount: Integer read;

Property Value

Type Description
Integer

The number of records that meet the active filter criteria.

This property value equals the RecordCount property value if no filter criterion is in effect.

Remarks

You can use FilteredRecordCount and FilteredRecordIndex properties to iterate through all records that meet the active filter criteria.

Code Example: Iterate through Records after Filtering

The following code example iterates through all records that meet the active filter criteria and populates a TcxMemo editor with values of the first field in the underlying dataset:

uses
  cxGridDBDataDefinitions;  // Declares the TcxGridDBDataController class

// ...
  var
    ADataController: TcxGridDBDataController;
    I: Integer;
  begin
    cxMemo1.Lines.Clear;
    ADataController := cxGrid1DBTableView1.DataController;
    for I := 0; to ADataController.FilteredRecordCount - 1 do
      cxMemo1.Lines.Add(ADataController.DisplayTexts[ADataController.FilteredRecordIndex[I], 0]);
  end;

Limitations

Do not use FilterRecordCount and FilteredRecordIndex properties in Grid and Server data access modes. The FilteredRecordCount property value does not reflect the actual number of records that meet the active filter criteria when the data controller does not store all records in memory.

See Also