Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TcxCustomDataController.FilteredRecordCount Property

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

#Declaration

Delphi
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;  // This unit 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;
See Also