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

How to disable AutoComplete in SfComboBox?

Platform: UWP |
Control: SfComboBox |
Published Date: December 27, 2017 |
Last Revised Date: December 27, 2017

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

 

 

 

 

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.

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