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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to set values ​​obtained from a data source?

Thread ID:





148191 Oct 9,2019 03:40 PM UTC Oct 16,2019 10:05 AM UTC Xamarin.Forms 3
Tags: SfAutoComplete
Andrés Alberto
Asked On October 9, 2019 03:43 PM UTC

Hi, I would like to know how I can set the values ​​that I get from a data source once the control loads.

For example, I want to edit an email and I would like to see by default the names of the people I selected when creating the email, and thus add or remove recipients in my control.

Additional I tell you that I am using MVVM


Hemalatha Marikumar [Syncfusion]
Replied On October 10, 2019 06:33 PM UTC

Hi Andrés Alberto,

Greetings from Syncfusion. 
We would like to let you know that your requirement “Display the item from DataSource, while control is being loaded” in SfAutoComplete has been achieved by using the SelectedItem property.  
Please have a below code example, 
Code snippet: 
  <autoComplete:SfAutoComplete HeightRequest="40"   
                             DataSource="{Binding EmployeeCollection}" 
                             SelectedItem="{Binding SelectedItem}" 
                             DisplayMemberPath="Name" /> 
We have prepared the sample based on your requirement, 
Sample Link: 
If we misunderstood your requirement, please update us with more details regarding your requirement and update any other video representation to know your exact scenario which will more helpful to investigate further and provide a better solution. 
Hemalatha M. 

Andrés Alberto
Replied On October 15, 2019 08:05 PM UTC

This works correctly, but how can I set more than one?

Hemalatha Marikumar [Syncfusion]
Replied On October 16, 2019 10:05 AM UTC

Hi Andrés Alberto,

Thanks for your update.

We would like to let you know that your requirement “Display more than one items in SfAutoComplete at initially” has been achieved by using MultiSelectMode which allows us to select the more than one items.

To know more about that, please refer the below UG


Here, we have achieved your requirement using Token type in MultiSelectionMode. And using the SelectedItem property, we can populate the desired items as selected items of AutoComplete.  Prepared sample can be downloaded from below link

Sample Link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/AutoComplete_Sample-2090213431 

Code Snippet:
<autoComplete:SfAutoComplete HeightRequest="40"   
                             DataSource="{Binding EmployeeCollection}" 
                             SelectedItem="{Binding SelectedItem}" 
                             DisplayMemberPath="Name" /> 

Please let us know if you have any concern.

Hemalatha M. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon