Articles in this section
Category / Section

How to change Suggestion Mode in SfAutoComplete

1 min read

Syncfusion SfAutocomplete in Xamarin has the feature of different Suggestion mode. The list of Suggestion mode is given below.

 

  • StartsWith
  • StartsWithCaseSensitive
  • Contains
  • ContainsWithCaseSensitive
  • Equals
  • EqualsWithCaseSensitive
  • EndsWith
  • EndsWithCaseSensitive

 

To add Data source in autocomplete follow the below given procedure:

 

Step 1: Create the autocomplete sample with all necessary assemblies.

 

Step 2: Create a class Countrylist and create an instance for list called countryList and then add the countries in the list using the function Add ().

 

Step 3: Mention any one of the above suggestion mode in the program.

 

The below code illustrates the way to achieve this.

 

Code snippet:

 

namespace Autocomplete
{
public partial class AutocompletePage : ContentPage
{
    public AutocompletePage()
    {
        //Initialize the autocomplete control.
        SfAutoComplete autocomplete = new SfAutoComplete();
        autocomplete.SuggestionMode = SuggestionMode.StartsWith;
 
        //List to be shown in the autocomplete control
        List<string> countryList = new List<string>();
        countryList.Add("Uganda");
        countryList.Add("Ukraine");
        countryList.Add("United States");
        countryList.Add("United Kingdom");
        countryList.Add("Uzbekistan");
        autocomplete.AutoCompleteSource = countryList;
 
        //Layou for the autocomplete control
        StackLayout autocompleteLayout = new StackLayout();
        autocompleteLayout.Children.Add(autocomplete);
        Content = autocompleteLayout;
    }
}
}

 

 

Image for Suggestion Mode StartWith:

 

Suggestion Mode StartWith in SfAutoComplete

 

 

 

Image for Suggestion Mode StartsWithCaseSensitive:

 

 

Suggestion Mode StartsWithCaseSensitive in SfAutoComplte

 

 

Image for Suggestion Mode Contains:

 

 

Suggestion Mode Contains SfAutoComplete

 

Image for Suggestion Mode ContainsWithCaseSensitive:

 

 

Suggestion Mode ContainsWithCaseSensitive in SfAutoComplete

 

 

 

 

Image for Suggestion Mode Equals:

 

 

Suggestion Mode Equals in SfAutoComplete

 

Image for Suggestion Mode EqualsWithCaseSensitive:

 

 

Suggestion Mode EqualsWithCaseSensitive

 

 

Image for Suggestion Mode EndsWithCaseSensitive:

 

Suggestion Mode EqualsWithCaseSensitive  SfAutoComplete

 

Image for Suggestion Mode EndsWith:

 

Suggestion Mode EndsWith SfAutoComplete

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied