Data.Win.ADODB.TCustomADODataSet.FilterGroup

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property FilterGroup: TFilterGroup read GetFilterGroup write SetFilterGroup;

C++

__property TFilterGroup FilterGroup = {read=GetFilterGroup, write=SetFilterGroup, nodefault};

Properties

Type Visibility Source Unit Parent
property public
Data.Win.ADODB.pas
Data.Win.ADODB.hpp
Data.Win.ADODB TCustomADODataSet

Description

Filters a recordset based on row update status.

Use FilterGroup to filter the recordset displayed with an ADO dataset component. The filter requires the dataset be in update batch mode and the rows are filtered based on the update status of individual rows. Set FilterGroup to a TFilterGroup constant to filter the dataset to show just the rows that match that batch update status. For instance, set FilterGroup to fgPendingRecords to show just the rows that have been modified since the last update application.



if (ADODataSet1.LockType = ltBatchOptimistic) then begin
ADODataSet1.Filtered := True;
ADODataSet1.FilterGroup := fgPendingRecords;
end;



if (ADODataSet1->LockType == ltBatchOptimistic)
{
ADODataSet1->Filtered = true;
ADODataSet1->FilterGroup = fgPendingRecords;
};



To use FilterGroup to filter based on the update status of rows, ensure that the LockType property is set to ltBatchOptimistic (a prerequisite for batch updating) and the Filtered property is set to true. In a filtered dataset, check the update status of individual rows using the RecordStatus property.

The TFilterGroup type consists of the following constants:



Filter group type Meaning

fgUnassigned

Specifies that no filtering is in effect. This constant is used internally by the ADO dataset component.

fgNone

Removes any current filtering and all rows are visible. Can also be done by setting the Filtered property to false.

fgPendingRecords

Filters to show just the rows that have been changed, whose changes have not been applied (UpdateBatch method) or canceled (CancelBatch).

fgAffectedRecords

Filters to show just the rows affected by the last update.

fgFetchedRecords

Filters to show just the rows in the current update cache. This is the result of the last call to retrieve rows from the database.

fgPredicate

Filters to show just the deleted rows.

fgConflictingRecords

Filters to show just the rows that had changes made to them, changes that could not be applied due to errors on the apply attempt.



See Recordset.Filter property

See Also