Filtering in Windows Forms ComboBox (SfComboBox)

27 Apr 20211 minute to read

The SfComboBox support you to filter the items by setting the Filter property of DropDownListView to a predicate that will be called for every data item to determine whether the item is visible or not.


The RefreshFilter() method should be called after the filter predicate set.

sfComboBox1.DropDownListView.View.Filter = FilterItem;

//Filter predicate
private bool FilterItem(object data)
  if ((data as USState).LongName.StartsWith("C"))
    return true;
  return false;
sfComboBox1.DropDownListView.View.Filter = AddressOf FilterItem

'Filter predicate
private Boolean FilterItem(Object data)
  If (TryCast(data, USState)).LongName.StartsWith("C") Then
	Return True
  End If
  Return False