ComboBox Filter not working when using ItemTemplate

Hello there

I have a ComboBox control with lots of data, in order to find an entry quickly I would like to just type into the ComboBox which works fine.


  1. Type in "ten"
  2. Component immediately SCROLLS DOWN and preselects "Tennis"

1.png

But when using Templates, the following happens...

  1. Type in "Gordon" (to look for "Gordon Woodard")
  2. Seemingly nothing happens...
2.png

When scrolling down MANUALLY, I can actually see "Gordon Woodard" being kinda selected (in gray instead of dark blue) but for huge lists this is not good enough:

So is filtering with templates simply not supported, is this a bug, or any other way to prevent this from happening?

Thanks a lot.

Cheers,
Lazar

(I attached my sample project for reference, I simply copy-pasted examples from blazor website and modified the results, nothing else!)

Attachment: BlazorSampleApp_d39a64ca.7z

3 Replies 1 reply marked as answer

SN Sevvandhi Nagulan Syncfusion Team July 29, 2021 01:21 PM UTC

Hi Lazar,

Greetings from Syncfusion support.

We checked your query. In the provided sample, you did not enable the filtering for the component. We request that you to enable filtering using AllowFiltering property. Refer the following code.

<SfComboBox TValue="string" TItem="EmployeeData" Placeholder="Select a customer" DataSource="@Data" AllowFiltering="true">
<ComboBoxTemplates TItem="EmployeeData">
<ItemTemplate>
<span><span class='name'>@((context as EmployeeData).FirstName)span><span class='country'>@((context as EmployeeData).Country)span>span>
ItemTemplate>
ComboBoxTemplates>
<ComboBoxFieldSettings Text="FirstName" Value="Country">ComboBoxFieldSettings>
SfComboBox>

Please find the modified sample below.


Kindly get back to us for further assistance.

Regards,
Sevvandhi N



Marked as answer

LG Lazar Gosic July 29, 2021 01:34 PM UTC

Hi Sevvandhi

I see, by allowing filtering it only shows entries which contain user input.

It behaves a little bit differently to a ComboBox without templates which scrolls to the appropriate entry and highlights it, which is a little bit weird.

But for my current use case, this solution will do just fine. So thank you!


Cheers,

Lazar



SN Sevvandhi Nagulan Syncfusion Team July 30, 2021 04:22 AM UTC

Hi Lazar, 



We are glad to hear that the reported issue has been resolved. Please get back to us if you need further assistance. 



Regards, 
Sevvandhi N 


Loader.
Up arrow icon