We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to filter %LIKE% in a dropdown list

How do we get the dropdown list to filter items containing the filtered value? My code below only seems to filter the start of the text. For example, we have customer code and customer number as an item. Sometimes the user wants to search by code and others by customer name.

BTW, I tried this with a dropdown template and it only searched on one of the fields. So I combined the fields at the datasource list call.

    <EjsDropDownList TValue="string" TItem="CustomerPickerItem" AllowFiltering=true IgnoreAccent=true Placeholder="Select a customer" DataSource="@CustomerList">
        <DropDownListFieldSettings Text="CodeName" Value="CustomerId"></DropDownListFieldSettings>
        <DropDownListEvents TValue="string" ValueChange="CustomerPickerChanged"></DropDownListEvents>

001 Mary Smith
234 John Doe


3 Replies

SN Sevvandhi Nagulan Syncfusion Team December 24, 2019 08:33 AM UTC

Hi Scott 
Greetings from Syncfusion support. 
You can filter the contains using the FilterType as contains. Kindly refer the below code, 
    <EjsDropDownList Placeholder="e.g. Australia" TValue="string" TItem="Countries" AllowFiltering=true IgnoreAccent=true DataSource="@Country" FilterType="Syncfusion.EJ2.Blazor.DropDowns.FilterType.Contains"> 
        <DropDownListFieldSettings Value="Code" Text="Name"></DropDownListFieldSettings> 
Please find the sample below, 
Sevvandhi N  

SP Scott Peal December 26, 2019 01:16 PM UTC

Fantastic, Thanks!

SN Sevvandhi Nagulan Syncfusion Team December 30, 2019 03:54 AM UTC

Hi Scott, 
Thanks for the update. Please let us know if you need any other further assistance on this.  
Sevvandhi N 

Live Chat Icon For mobile
Up arrow icon