Various filter options for suggestion
29 Jun 20182 minutes to read
The combo box enables filer option for filtering the suggestions in the drop-down.
combobox.AllowFiltering = true;
combobox.IsEditableMode = true;
Types Of filtering
The phenomenon of string comparison for filtering suggestions can be changed using the SuggestionMode
property. The default filtering strategy is StartsWith
and it is case insensitive. The available filtering modes are,
-
StartsWith
-
StartsWithCaseSensitive
-
Contains
-
ContainsWithCaseSensitive
-
Equals
-
EqualsWithCaseSensitive
-
EndsWith
-
EndsWithCaseSensitive
-
Custom
Words that starts with input text
Displays a list of suggestions based on the starting letter.
combobox.SuggestionMode = SuggestionMode.StartsWith;
Filter with character casing
Displays a list of suggestions based on the starting letter with case sensitive.
combobox.SuggestionMode = SuggestionMode.StartsWithCaseSensitive;
Words that contain the input text
Displays a list of suggestions if the combo box list contains that words.
combobox.SuggestionMode = SuggestionMode.Contains;
Filter with character casing
Displays a list of suggestions if the combo box list contains that words with case sensitive.
combobox.SuggestionMode = SuggestionMode.ContainsWithCaseSensitive;
Words that equals to input text
Displays the word that matches the input text.
combobox.SuggestionMode = SuggestionMode.Equals;
Filter with character casing
Displays the word that matches the input text with case sensitive.
combobox.SuggestionMode = SuggestionMode.EqualsWithCaseSensitive;
Words that ends with input text
Displays a list of suggestions based on the ending word.
combobox.SuggestionMode = SuggestionMode.EndsWith;
Filter with character casing
Displays a list of suggestions based on the ending word with case sensitive.
combobox.SuggestionMode = SuggestionMode.EndsWithCaseSensitive;
Custom filter
Displays a list of suggestions based on the custom words in the combo box.
combobox.SuggestionMode = SuggestionMode.Custom;