TcxFilterCriteria.OnChanged Event
This event fires after filter criteria have changed.
Declaration
property OnChanged: TNotifyEvent read; write;
Remarks
TcxFilterCriteria class descendants fire this event after applying new filter conditions to data provided by a data controller. The event also fires when you activate or disable the filtering feature using the TcxDataFilterCriteria.Active property.
The Sender parameter represents the filter criteria.
Explore the example where TcxGrid and TcxFilterControl controls are placed on a form. The grid control displays data within the tvCustomers view. The filter control is linked to this view via the TcxFilterControl.LinkComponent property and this enables displaying the filter criteria applied to the view within the filter control.
However, the filter control is not automatically updated when you change the filter for the view, for instance, when you select the value from the filter dropdown list. You need to manually update the filter criteria provided in the filter control using the OnChanged event. The following code shows the OnChanged event to invoke the UpdateFilter method of the filter control.
procedure TForm1.tvCustomersDataControllerFilterChanged(Sender: TObject);
begin
cxFilterControl1.UpdateFilter;
end;