Gets or sets a custom filter that will filter the
ItemsSource while text is being typed in the
ComboBox.
In the following example, every time a new character is typed, every item of the ComboBox will call the IsItemPassFilter method.
Only the items that start with the characters typed in the ComboBox will pass the filter & be displayed in the Popup. This means that if the characters "C" & "A" are typed in the ComboBox, the ItemsSource will be filtered so that only the items that start with "CA" are displayed in the ComboBox's Popup.
var newCustomFilterAction = new MyComboBoxCustomFilterAction();
comboBox.CustomFilterAction = newCustomFilterAction;
private class MyComboBoxCustomFilterAction : ICustomFilterAction
{
public bool IsItemPassFilter( object item, string filterText )
{
return (( string )item).StartsWith( filterText );
}
}
Target Platforms: Windows 11, Windows 10, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2