Use Chip in Autocomplete

Hi There,

Any idea how you would be able to use a chip in the autocomplete field?  the idea is for the user to search for an item, and when selected, it shows as a chip in the control.  if the user clicks on the close button, the autocomplete is cleared, 

I'm trying to get the same type of functionality as using a multiselect control with a limitation of 1 item selected, in Box mode.  The TValue string[] in multiselect is messing a bit with my code.

Any thoughts?

1 Reply

SN Sevvandhi Nagulan Syncfusion Team April 13, 2020 09:23 AM UTC

Hi Jaques,  

Greetings from Syncfusion support.  

We could not achieve the reported requirement in the AutoComplete since we don’t have ValueTemplate support for this component. We suggest to use the MultiSelect control with Box mode and Selection Limit as 1 to behave as like the mentioned requirement. We have prepared the test sample for you. Kindly check the sample and screenshot below,  
 
  
 
Code Snippet:   
 
  
<SfMultiSelect TValue="string[]" Placeholder="e.g. Australia" Mode="VisualMode.Box"DataSource="@Country" MaximumSelectionLength="1">  
    <MultiSelectFieldSettings Value="Code" Text="Name"></MultiSelectFieldSettings>  
</SfMultiSelect>  
 
 
Also, revert us with the issue details, you have facing in the MultiSelect Tvalue. 
 
Regards,  
Sevvandhi N  


Loader.
Up arrow icon