Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

SearchSettingsBuilder.FilterInterval(String) Method

Specifies the function that filters search results.

Namespace: DevExpress.AspNetCore.RichEdit

Assembly: DevExpress.AspNetCore.RichEdit.v24.2.dll

NuGet Package: DevExpress.AspNetCore.RichEdit

#Declaration

C#
public SearchSettingsBuilder FilterInterval(
    string filterInterval
)

#Parameters

Name Type Description
filterInterval String

The name of the JavaScript function or the JavaScript function code that filters search results.

#Returns

Type Description
SearchSettingsBuilder

An object that can be used to further configure search settings.

#Remarks

The search panel and the Find and Replace dialog allow users to locate and modify text in the Rich Text Editor’s documents. Specify the filterInterval function to filter search results and prevent users from modifying certain document intervals.

The Rich Text Editor executes the filterInterval function for each search result. This function should accept the sub-document and text interval that contain the current search result and return a Boolean value. The control displays the search result if the filterInterval function returns true; otherwise, the control hides this result.

The example below demonstrates how to exclude intervals that contain fields from search results:

<script>
   function displaySearchResult(subDocument, interval) {
       return subDocument.fields.find(interval).length == 0;
   }
</script>
@(Html.DevExpress().RichEdit("RichEdit")
   .Search(searchSettings => {
       searchSettings.FilterInterval("displaySearchResult");
   })
   // ...
)
See Also