Auto Complete in Windows Forms ComboBox (SfComboBox)

Auto complete can be enabled by using the SfComboBox.AutoCompleteMode property. Three different ways to display the suggestions are:

  • Suggest: Displays suggestion in drop-down list.
  • Append: Appends the first suggestion to text.
  • SuggestAppend: Performs both the above ways.

Auto complete modes

Suggest

A list of probable matches will be suggested and displayed in the drop-down list by setting the AutoCompleteMode property as Suggest.

sfComboBox1.AutoCompleteMode = AutoCompleteMode.Suggest;
sfComboBox1.AutoCompleteMode = AutoCompleteMode.Suggest

AutoCompleteMode as suggest

Append

The closest match will be added to the editor portion of the SfComboBox control with partial string selection in the drop-down list. This mode can be enabled by setting the AutoCompleteMode property as Append.

sfComboBox1.AutoCompleteMode = AutoCompleteMode.Append;
sfComboBox1.AutoCompleteMode = AutoCompleteMode.Append

AutoCompleteMode as Append

Suggest append

The closest match will be added in the editor portion of the SfComboBox control with partial string selection. The list of matched items will be displayed in the drop-down list by setting the AutoCompleteMode property as SuggestAppend.

sfComboBox1.AutoCompleteMode = AutoCompleteMode. SuggestAppend;
sfComboBox1.AutoCompleteMode = AutoCompleteMode.SuggestAppend

AutoCompleteMode as SuggestAppend

Auto complete by case sensitive

By default, auto completion is case in-sensitive. Case sensitivity can be enabled by setting the AllowCaseSensitiveOnAutoComplete property to true.

sfComboBox1.AllowCaseSensitiveOnAutoComplete = true;
sfComboBox1.AllowCaseSensitiveOnAutoComplete = True

Filter drop-down items with case sensitive

Different modes for suggesting items

StartsWith and Contains modes are used to auto complete the items by using the AutoCompleteSuggestMode property. The default value is StartsWith.

sfComboBox1.AutoCompleteSuggestMode = AutoCompleteSuggestMode.Contains;
sfComboBox1.AutoCompleteSuggestMode = AutoCompleteSuggestMode.Contains

AutoCompleteSuggestion option as contains

Setting delay for auto complete

The SfComboBox provides support to set delay in milliseconds when suggesting matches on auto completion process by using the AutoCompleteSuggestDelay property. The default suggest delay is 0.

sfComboBox1.AutoCompleteSuggestDelay = 1000;
sfComboBox1.AutoCompleteSuggestDelay = 1000

NOTE

The AutoCompleteSuggestDelay property is valid only for Suggest and SuggestAppend modes.