)
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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to Enable or Disable the AutoComplete Control

Platform: Xamarin.Forms |
Control: SfAutoComplete |
Published Date: April 10, 2017 |
Last Revised Date: June 24, 2019

Syncfusion Autocomplete in Xamarin provides IsEnable property. To make the Autocomplete textbox to get Enabled and Disabled.

 

For Enable and Disable the SfAutoComplete control 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: Make the changes with the IsEnable Property as True or False to make the Autocomplete to be Enable or Disable vice versa.

 

The below code illustrates the way to achieve this.

 

Code snippet:

namespace Autocomplete
{
public partial class AutocompletePage : ContentPage
{
    public AutocompletePage()
    {
        InitializeComponent();
        //Initialize the autocomplete control.
        SfAutoComplete autocomplete = new SfAutoComplete();
        autocomplete.IsEnabled = false;//For enable set true, for disable set false. 
        //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;
        //Layout for the autocomplete control
        StackLayout autocompleteLayout = new StackLayout();
        autocompleteLayout.Padding = new Thickness(50, 100, 50, 0);
        autocompleteLayout.Children.Add(autocomplete);
        Content = autocompleteLayout;
    }
}
}

 

Image for Enable:

IsEnabled is True in SfAutoComplete

 

 

Image for Disable:

IsEnabled is False in SfAutoComplete

 

2X faster development

The ultimate Xamarin UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

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

Up arrow icon

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