We have SearchControl (added in v14.1), which provides the search and filter functionality for the attached object. SearchControl can be attached to objects that support the ISearchControlClient interface. You can find a list of our controls that support this interface out of the box in the SearchControl help topic.
However, this list can be extended by your own. This example illustrates how to implement the ISearchControlClient interface for a Form for searching and highlighting controls by their names.
To introduce the ISearchControlClient interface into your project, implement the following members:
- SetSearchControl - this method is invoked when you attach/detach your object from the SearchControl.Client property.
- IsAttachedToSearchControl - this property determines whether your object is attached to SearchControl.
- ApplyFindFilter - this method is invoked when filtering is performed. Here you need to implement your own logic for filtering.
- CreateSearchProvider - this method must return SearchControlProviderBase's descendant. This provider contains SearchText and FilterCondition obtained from the RepositoryItemSearchControl.FilterCondition property.
It is necessary to override the SearchControlProviderBase.GetCriteriaInfoCore method to return SearchInfoBase's descendant. This instance should contain all required information for your filtering. It is passed to the ApplyFindFilter method as a parameter.
See also:
How to support the ISearchControlClient interface for TileControl to use SearchControl with it
↧
How to implement the ISearchControlClient interface
↧