Skip to main content
All docs
V24.1

DxHtmlEditorMention.SearchMinLength Property

Specifies the minimum number of characters a user must type to start a search operation.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[DefaultValue(0)]
[Parameter]
public int SearchMinLength { get; set; }

Property Value

Type Default Description
Int32 0

The minimum number of characters in a search entry.

Remarks

<DxHtmlEditor> supports mention functionality. When a user types a predefined marker, the component displays a list of available items. To enable search operations for mentions, specify the SearchFieldNames property.

Use the SearchMinLength property to define the minimum search string length required to start a search operation.

Example

The following code snippet requires a user to type at least 4 characters to search data:

<DxHtmlEditor Height="200px">
    <DxHtmlEditorMentions>
        <DxHtmlEditorMention Data="@EmployeesData"
                             DisplayFieldName="@nameof(MentionData.Name)"
                             SearchFieldNames="@SearchFieldNames"
                             SearchMinLength="4" />
    </DxHtmlEditorMentions>
</DxHtmlEditor>

@code {
    string[] SearchFieldNames = { nameof(MentionData.Name) };

    class MentionData {
        public string Name { get; set; }
        public string Team { get; set; }
    }
    MentionData[] EmployeesData = {
        new MentionData() { Name = "John Heart", Team = "Engineering" },
        new MentionData() { Name = "Kevin Carter", Team = "Engineering" },
        new MentionData() { Name = "Olivia Peyton", Team = "Management" },
        new MentionData() { Name = "Robert Reagan", Team = "Management" },
        new MentionData() { Name = "Cynthia Stanwick", Team = "Engineering" },
        new MentionData() { Name = "Brett Wade", Team = "Analysis" },
        new MentionData() { Name = "Greta Sims", Team = "QA" },
    };
}
See Also