How can I set value in code for AutoComplete?

I have collection List like autoComplete.DataSource. And I need select first value in datasource like current choose in programming code and the event AutoCompleteItemSelected needs to be triggered. autoComplete.SelectedValue = "value" don't work. I want to work like here: https://help.syncfusion.com/aspnetmvc/autocomplete/how-to?cs-save-lang=1&cs-lang=razor, only for WinForms.


3 Replies

VR Vijayalakshmi Roopkumar Syncfusion Team July 30, 2021 03:49 AM UTC

Hi Artem 
  
Thank you for your interest in Syncfusion Products. 
  
We are currently checking about your requirement in selecting value. We will work on it and provide the solution by today. 
  
Regards, 
Vijayalakshmi VR 



BC Ben Croughs December 12, 2022 10:47 AM UTC

Hey,


if you do this, also do it for the SyncFusion Blazor AutoComplete, because it is not working on that component also.


Regards



HN Harinath Navaneethakrishnan Syncfusion Team December 22, 2022 12:03 PM UTC

Winforms AutoComplete:

We have logged a feature request for your requirement “Support to update the selected item programmatically in AutoComplete” and it can be tracked through our feedback portal below. 


Feedback link: https://www.syncfusion.com/feedback/39983/support-to-update-the-selected-item-programmatically-in-autocomplete

We will prioritize the features every release based on the demands, and we do not have an immediate plan to implement this since we are committed to already planned work. So, this feature will be available for any of our upcoming releases. 


Please cast your vote to make it count and if you have any more specifications/suggestions for the feature request, you can add them as a comment in the feedback portal. 


Blazor Autocomplete:

You can set the default value of autocomplete using the value property. please find the attached sample and code for your reference.


<SfAutoComplete Value="@Value">

</SfAutoComplete>

 

@code {

    public string Value { getset; } = "Canada";

}


Attachment: BlazorApp1_5632b6b1_8eadd901.zip

Loader.
Up arrow icon