TDynFilterContents - Events - Methods - Properties
Dynamic filter for TDataSet
Description
Simplifies creating and managing runtime by user-changeable filters.Usually, no one line of code-writing is needed to realize the data filtering interface for the end-user.
Various filter operations: =, >, <, >=, <=, <>, begins, contains, partial match; case on/off, etc.
Various user interface components:
TDynFilterEdit , TDynFilterEditBtn , TDynFilterCheckBox , TDynFilterComboBox , TDynFilterRadioGroup , TDynFilterDBCombo .
Contents - TDynFilter - Properties - Methods
OnRefreshData
Data refresh eventDelphi declaration
property OnRefreshData: TDfRefreshDataEvent read FOnRefreshData write FOnRefreshData;
C++ declaration
__property TDfRefreshDataEvent OnRefreshData={ read=FOnRefreshData, write=FOnRefreshData }
Description
Forced before the filter calls the DataSet-s Refresh method.If you prefer some other method instead of the internal DataSet->Refresh, then this is the right place.
Contents - TDynFilter - Properties - Events
~TDynFilter
DestructorClear
Clear all filterconditionsCreateDelphi declaration
procedure Clear;
C++ declaration
void __fastcall Clear(void)
Description
Forces Refresh .
Delphi declarationDestroy
constructor Create(AOwner: TComponent);
Delphi declarationDFTextToDate
destructor Destroy;
Internal string to date conversionDFTextToNumericDelphi declaration
function DFTextToDate(const sText: string): TDateTime;
C++ declaration
System::TDateTime __fastcall DFTextToDate(const System::AnsiString sText)
Internal string to numeric conversionInternalUpdateFilterDelphi declaration
function DFTextToNumeric(const sText: string; const bDecimalsEnabled: Boolean): Double;
C++ declaration
double __fastcall DFTextToNumeric(const System::AnsiString sText, const bool bDecimalsEnabled)
Description
bDecimalsEnabled FALSE disables decimal places (used in the case of integers)
Internal filter refreshIsCompatibleFieldDelphi declaration
procedure InternalUpdateFilter;
C++ declaration
void __fastcall InternalUpdateFilter(void)
Field compatibility checkNotificationDelphi declaration
function IsCompatibleField(Field: TField): Boolean;
C++ declaration
bool __fastcall IsCompatibleField(Db::TField *Field)
Description
TDynFilter cannot be used for calculated and lookup fields.
Overrides the inherited method to respond to opRemove notifications on the linked DataSet.PartialStrCompareDelphi declaration
procedure Notification(AComponent: TComponent; Operation: TOperation);
C++ declaration
virtual void __fastcall Notification(Classes::TComponent *AComponent, Classes::TOperation Operation)
Internal advanced string comparing functionRefreshDelphi declaration
function PartialStrCompare(const sString1: string; const sCondString: string): Boolean;
C++ declaration
bool __fastcall PartialStrCompare(const System::AnsiString sString1, const System::AnsiString sCondString)
Description
Used, when the operation is foPartialMatch.
Refresh dataset immediatelySetAllFilterBoolCondDelphi declaration
procedure Refresh;
C++ declaration
void __fastcall Refresh(void)
Description
Usable, if AutoRefresh=false.
Setting all filterconditions for Boolean-field at the same timeSetAllFilterCondDelphi declaration
procedure SetAllFilterBoolCond(const FieldName: string; const ComponentName: string; const bCondBoolType: Boolean; const Value: Boolean);
C++ declaration
void __fastcall SetAllFilterBoolCond(const System::AnsiString FieldName, const System::AnsiString ComponentName, const bool bCondBoolType, const bool Value)
Description
Forces UpdateFilter
Setting all filterconditions for field at the same time, condition as stringTDynFilterDelphi declaration
procedure SetAllFilterCond(const FieldName: string; const ComponentName: string; const sCondString: string; const bCaseInsensitive: Boolean; const iFilterOperation: TDynFilterOperation; const bCompareOrdValues: Boolean; const bCompareEmptyValue: Boolean);
C++ declaration
void __fastcall SetAllFilterCond(const System::AnsiString FieldName, const System::AnsiString ComponentName, const System::AnsiString sCondString, const bool bCaseInsensitive, const TDynFilterOperation iFilterOperation, const bool bCompareOrdValues, const bool bCompareEmptyValue)
Description
Forces UpdateFilter
ConstructorUpdateFilterC++ declaration
__fastcall virtual TDynFilter(Classes::TComponent *AOwner)
Refresh dataset, if AutoRefresh=trueDelphi declaration
procedure UpdateFilter;
C++ declaration
void __fastcall UpdateFilter(void)
Description
Case of AutoRefresh =false does nothing!
Contents - TDynFilter - Methods - Events
AutoRefresh
Refresh filtered DataSet immediately after every filter changeCaseInsensitiveDelphi declaration
property AutoRefresh: Boolean read FAutoRefresh write FAutoRefresh default true;
C++ declaration
__property bool AutoRefresh={ read=FAutoRefresh, write=FAutoRefresh, default=1 }
Description
In the case AutoRefresh=FALSE, you can change more filterconditions and then call DynFilter ->Refresh();In the case AutoRefresh=TRUE, every change refreshes the filtered DataSet.
Remark: Setting AutoRefresh property to TRUE doesn't force DynFilter->Refresh!
Case-property for field filterconditionCompareEmptyValueDelphi declaration
property CaseInsensitive[const FieldName: string]: Boolean read GetCaseInsensitive write SetCaseInsensitive;
C++ declaration
__property bool CaseInsensitive[System::AnsiString FieldName]={ read=GetCaseInsensitive, write=SetCaseInsensitive }
Description
Usable, when comparing as string
Compare-to-empty value property for field filterconditionCompareOrdValuesDelphi declaration
property CompareEmptyValue[const FieldName: string]: Boolean read GetCompareEmptyValue write SetCompareEmptyValue;
C++ declaration
__property bool CompareEmptyValue[System::AnsiString FieldName]={ read=GetCompareEmptyValue, write=SetCompareEmptyValue }
Description
If set, empty fieldcondition will be compared against the empty fieldvalue,otherwise, an empty fieldcondition means that no condition is set.
Compare ordinal value property for field filterconditionCondAsBoolFalseDelphi declaration
property CompareOrdValues[const FieldName: string]: Boolean read GetCompareOrdValues write SetCompareOrdValues;
C++ declaration
__property bool CompareOrdValues[System::AnsiString FieldName]={ read=GetCompareOrdValues, write=SetCompareOrdValues }
Description
If false, compared as string
Boolean-false condition value for field filterconditionCondAsBoolTrueDelphi declaration
property CondAsBoolFalse[const FieldName: string]: Boolean read GetCondAsBoolFalse write SetCondAsBoolFalse;
C++ declaration
__property bool CondAsBoolFalse[System::AnsiString FieldName]={ read=GetCondAsBoolFalse, write=SetCondAsBoolFalse }
Description
Used in pair with CondAsBoolTrue.
Boolean-true condition value for field filterconditionCondAsDateTimeDelphi declaration
property CondAsBoolTrue[const FieldName: string]: Boolean read GetCondAsBoolTrue write SetCondAsBoolTrue;
C++ declaration
__property bool CondAsBoolTrue[System::AnsiString FieldName]={ read=GetCondAsBoolTrue, write=SetCondAsBoolTrue }
Description
Used in pair with CondAsBoolFalse.
Condition value for field filtercondition as TDateTimeCondAsFloatDelphi declaration
property CondAsDateTime[const FieldName: string]: TDateTime read GetCondAsDateTime write SetCondAsDateTime;
C++ declaration
__property System::TDateTime CondAsDateTime[System::AnsiString FieldName]={ read=GetCondAsDateTime, write=SetCondAsDateTime }
Description
Setting the parameter forces also the CondString parameter to be evaluated respectively.
Condition value for field filtercondition as doubleCondAsIntegerDelphi declaration
property CondAsFloat[const FieldName: string]: Double read GetCondAsFloat write SetCondAsFloat;
C++ declaration
__property double CondAsFloat[System::AnsiString FieldName]={ read=GetCondAsFloat, write=SetCondAsFloat }
Description
Setting the parameter forces also the CondString parameter to be evaluated respectively.
Condition value for field filtercondition as integerCondStringsDelphi declaration
property CondAsInteger[const FieldName: string]: Longint read GetCondAsInteger write SetCondAsInteger;
C++ declaration
__property long CondAsInteger[System::AnsiString FieldName]={ read=GetCondAsInteger, write=SetCondAsInteger }
Description
Setting the parameter forces also the CondString parameter to be evaluated respectively.
Condition value for field filtercondition as stringDataSetDelphi declaration
property CondStrings[const FieldName: string]: AnsiString read GetCondStrings write SetCondStrings;
C++ declaration
__property System::AnsiString CondStrings[System::AnsiString FieldName]={ read=GetCondStrings, write=SetCondStrings }
Description
If ordinal comparing is required, string will be converted to adequate datatype (double, TDateTime, integer, boolean).Empty condstring means that field filter is off (except, if compared to empty value).
Filtered DataSetDefaultCaseInsensitiveDelphi declaration
property DataSet: TDataSet read FDataSet write SetDataSet nodefault;
C++ declaration
__property Db::TDataSet *DataSet={ read=FDataSet, write=SetDataSet, nodefault }
Description
Warning: filter hooks at runtime to DataSet's events OnFilterRecord and AfterOpen (old events will be replaced and called inside the filter)!Therefore, it is not recommended to change DataSet's OnFilterRecord and AfterOpen events at runtime.
Default case-property value for filterconditionsDefaultCompareOrdValuesDelphi declaration
property DefaultCaseInsensitive: Boolean read FDefaultCaseInsensitive write FDefaultCaseInsensitive default true;
C++ declaration
__property bool DefaultCaseInsensitive={ read=FDefaultCaseInsensitive, write=FDefaultCaseInsensitive, default=1 }
Default compare ordinal value property value for filterconditionsDefaultFilterOperationDelphi declaration
property DefaultCompareOrdValues: Boolean read FDefaultCompareOrdValues write FDefaultCompareOrdValues default true;
C++ declaration
__property bool DefaultCompareOrdValues={ read=FDefaultCompareOrdValues, write=FDefaultCompareOrdValues, default=1 }
Default filter operation for filterconditionsFilterActiveDelphi declaration
property DefaultFilterOperation: TDynFilterOperation read FDefaultFilterOperation write FDefaultFilterOperation default foContains;
C++ declaration
__property TDynFilterOperation DefaultFilterOperation={ read=FDefaultFilterOperation, write=FDefaultFilterOperation, default=0 }
Switch DynFilter filtering on/offFilterOperationDelphi declaration
property FilterActive: Boolean read FFilterActive write SetFilterActive default true;
C++ declaration
__property bool FilterActive={ read=FFilterActive, write=SetFilterActive, default=1 }
Description
Doesn't affect other DataSet filters.
Filteroperation for field filterconditionIgnoreOnPartialMatchDelphi declaration
property FilterOperation[const FieldName: string]: TDynFilterOperation read GetFilterOperation write SetFilterOperation;
C++ declaration
__property TDynFilterOperation FilterOperation[System::AnsiString FieldName]={ read=GetFilterOperation, write=SetFilterOperation }
Words (phrases) ignored by foPartialMatchInternalTxtFloatDateConvDelphi declaration
property IgnoreOnPartialMatch: TStrings read FIgnoreOnPartialMatch write SetIgnoreOnPartialMatch;
C++ declaration
__property Classes::TStrings *IgnoreOnPartialMatch={ read=FIgnoreOnPartialMatch, write=SetIgnoreOnPartialMatch, nodefault }
Use internal text -to-date and text -to-float conversions instead of standardLicenceKeyDelphi declaration
property InternalTxtFloatDateConv: Boolean read FInternalTxtFloatDateConv write FInternalTxtFloatDateConv default false;
C++ declaration
__property bool InternalTxtFloatDateConv={ read=FInternalTxtFloatDateConv, write=FInternalTxtFloatDateConv, default=0 }
Description
TDynFilter has internal converters for txt<->numeric and txt<->date.Internal date format is "dd[[.mm].[yy]yy]", a missing month and/or year will be replaced with the current.
Internal txt->numeric conversion accepts different decimal separators.
To switch to more standard methods, set InternalTxtFloatDateConv to FALSE;
(in this case methods like StrToFloat, StrToInt, StrToDate etc. are used).
License keyShowHourGlassDelphi declaration
property LicenceKey: TEKeyProp read FKeyProp write FKeyProp;
C++ declaration
__property Unkeyprop::TEKeyProp *LicenceKey={ read=FKeyProp, write=FKeyProp, nodefault }
Show hourglass during DataSet refreshDelphi declaration
property ShowHourGlass: Boolean read FShowHourGlass write FShowHourGlass default true;
C++ declaration
__property bool ShowHourGlass={ read=FShowHourGlass, write=FShowHourGlass, default=1 }