Back to Devexpress

TdxCustomMemData.ProgrammedFilter Property

vcl-dxmdaset-dot-tdxcustommemdata-5698e594.md

latest2.2 KB
Original Source

TdxCustomMemData.ProgrammedFilter Property

Specifies the active data filtering mode.

Declaration

delphi
property ProgrammedFilter: Boolean read; write;

Property Value

TypeDescription
BooleanFalse Default. You can handle the OnFilterRecord event to implement a custom data filtering algorithm.TrueYou can use the FilterList property to populate the list of filtered dataset records based on custom criteria. The OnFilterRecord event does not occur in this mode.

Remarks

You can set the ProgrammedFilter property to True to populate the list of filtered records accessible through the FilterList property.

Code Example: Populate Filtered Record Lists

The following code example populates the list of filtered records accessible through the FilterList property:

delphi
var
  AGroupIDField: TField;
begin
  dxMemData1.ProgrammedFilter := True;
  AGroupIDField := dxMemData1.FieldByName('GroupID');
  while not dxMemData1.Eof do
  begin
    if AGroupIDField.AsInteger = 1 then
      dxMemData1.FilterList.Add(dxMemData1.RecNo);
    dxMemData1.Next;
  end;
  dxMemData1.Filtered := True;
end;
cpp
TField *AGroupIDField;
  // ...
  dxMemData1->ProgrammedFilter = true;
  AGroupIDField = dxMemData1->FieldByName("GroupID");
  do
  {
    if(AGroupIDField->AsInteger == 1)
      dxMemData1->FilterList->Add(dxMemData1->RecNo);
    dxMemData1->Next();
  } while(!dxMemData1->Eof);
  dxMemData1->Filtered = true;

Default Value

The ProgrammedFilter property’s default value is False.

See Also

TdxCustomMemData.FilterList Property

TdxCustomMemData Class

TdxCustomMemData Members

dxmdaset Unit