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

How to disable AutoComplete in SfComboBox?

AutoComplete present in the SfTextBoxExt has been disabled using property named “AutoCompleteMode”, which is present inside the SfComboBox and it can be retrieved using “FindVisualChildren” function.

 

The following code example demonstrates the same.

Xaml

 

<input:SfComboBox x:Name="sfComboBox"  Width="150"                                       DisplayMemberPath="Name" ComboBoxMode="Editable" Loaded="sfCombo_Loaded"/>

 

C#:

public static IEnumerable<T> FindVisualChildren<T>(DependencyObject depObj) where T : DependencyObject

{

   if (depObj != null)

   {

     for (int i = 0; i < VisualTreeHelper.GetChildrenCount(depObj); i++)

     {

         DependencyObject child = VisualTreeHelper.GetChild(depObj, i);

         if (child != null && child is T)

         {

               yield return (T)child;

         }        

         foreach (T childOfChild in FindVisualChildren<T>(child))

         {

              yield return childOfChild;

          }

       }

    }

  }

  private void sfCombo_Loaded(object sender, RoutedEventArgs e)

  {

     SfTextBoxExt text = FindVisualChildren<SfTextBoxExt>( sfComboBox).First();

     if (text != null)

         text.AutoCompleteMode = AutoCompleteMode.None;

  }

 

C:\Users\keerthana.jegannatha\AppData\Local\Microsoft\Windows\INetCache\Content.Word\sfCombobox.png

            Fig 1: With/Without AutoComplete in SfComboBox

 

 

 

 

Article ID: Published Date: Last Revised Date: Platform: Control:
8261 12/27/2017 12/27/2017 UWP SfComboBox
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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.