Getting Started with Xamarin.iOS AutoComplete

17 May 20221 minute to read

This section explains you the steps to configure a SfAutoComplete control in a real-time scenario and also provides a walk-through on some of the customization features available in SfAutoComplete control.

Referencing Essential Studio Components in Your Solution

After installing Essential Studio for Xamarin, you can find all the required assemblies in the installation folders, typically:

{Syncfusion Installed location}\Essential Studio {version number}\lib

And below assembly reference to the iOS unified project.


Add SfAutoComplete

  • Adding namespace for the added assemblies.
using Syncfusion.SfAutoComplete.iOS;
  • Now add the SfAutoComplete control with a required optimal name by using the included namespace.
SFAutoComplete countryAutoComplete=new SFAutoComplete(); 

Add Items

A list of string with country names are created and added to auto complete source. This list will be populated as suggestion list based on text entry.

NSMutableArray countryList=new NSMutableArray();
countryList.Add((NSString)"United Arab Emirates"); 
countryList.Add((NSString)"United Kingdom");
countryList.Add((NSString)"United States"); 
countryAutoComplete.AutoCompleteSource= countryList;

Set Filter Mode

Filters can be applied to the displayed items based on starting letter. We can also append the first item from the suggested list to the TextBox. This can be done by using the SuggestionMode and AutoCompleteMode properties in SfAutoComplete control.

The following example shows the SfAutoComplete control which suggest the country list starting with the letter U.

countryAutoComplete.Watermark=(NSString)"Enter a country name";
countryAutoComplete.PopUpDelay = 100;

Xamarin.iOS AutoComplete Getting Started Set Filter mode