The CustomBuildCriteria event's data class is CustomBuildCriteriaEventArgs. The following properties provide information specific to this event:
|Criteria||Specifies the CriteriaOperator to be used by the FullTextSearch Action to filter a List View.|
|Handled||Gets or sets a value that indicates whether the event handler has completely handled the event or whether the system should continue its own processing. Inherited from HandledEventArgs.|
|SearchText||Returns the user-entered string, based on which the FullTextSearch Action performs its search in the current List View.|
Handle this event if you need to modify the approach by which the CriteriaOperator is constructed by the FullTextSearch Action. In the event handler, create a custom CriteriaOperator, based on the string supplied by the handler's SearchText parameter. You can also create a custom CriteriaOperator, based on the handler's SearchTextSearchTextWithEscapeCharacters property, to prohibit end-users from using wildcard characters. Pass the instantiated CriteriaOperator to the Criteria parameter. Set the handler's Handled parameter to true, to indicate that the default criteria generation must not take place. If you do not set the Handled parameter to true, the criteria generation will be performed via the specially created SearchCriteriaBuilder object. The properties included in the criterion are determined by the FilterController.FullTextSearchTargetPropertiesMode property, and the SearchClassOptions and SearchMemberOptions attributes, if they are applied to the target class and its members.
As an alternative to handling this event, you can use a custom Search Criteria Builder, by implementing the ISearchCriteriaBuilder. You can also inherit the SearchCriteriaBuilder that implements this interface, and exposes useful protected methods. To specify a custom Search Criteria Builder, override the CreateSearchCriteriaBuilder method in the FilterController class descendant. In this instance, your builder's BuildCriteria method will be called to generate the criterion. To use a custom set of properties in the generated criteria, handle the FilterController.CustomGetFullTextSearchProperties event, or override the OnCustomGetFullTextSearchProperties method.
If you handle the CustomBuildCriteria event and set the handler's Handled parameter to true, the FilterController.CustomGetFullTextSearchProperties event is not triggered.
To learn about the FillTextSearch Action, refer to the FilterController.FullTextFilterAction property description.