Skip to main content

FuzzySort

Namespace: Wisej.Ext.FuzzySort

Assembly: Wisej.Ext.FuzzySort (4.1.0.0)

Provides extension methods that add fuzzy search to Wisej.NET controls.

public static class FuzzySort

Methods​

Static member ApplyFuzzySort(control)​

Enables fuzzy matching on the specified ComboBox.

ParameterTypeDescription
controlComboBoxThe ComboBox to enhance with fuzzy search.

Returns: ComboBox. The same control instance, allowing calls to be chained.

This method sets AutoCompleteMode to Filter, pushes the change to the client, and then starts the client-side fuzzy search on the control. As the user types, the drop-down items are filtered and matched with the fuzzysort library, and the matching characters in each item are highlighted.

Call this method after the control has been created. Setting AutoCompleteMode to a different value afterwards turns off the filtering behavior.

Example:

The following example fills a ComboBox with items and enables fuzzy search on it:

using Wisej.Web;
using Wisej.Ext.FuzzySort;

var comboBox = new ComboBox();
comboBox.Items.AddRange(new object[] { "Apple", "Apricot", "Banana", "Blueberry", "Cherry" });
comboBox.ApplyFuzzySort();

this.Controls.Add(comboBox);