New to Telerik UI for WinForms? Download free 30-day trial

Filtering

RadDropDownList supports filtering of its items. In order to apply a filter, you should set the Filter property of RadDropDownList to a predicate that will be called for every data item in order to determine if the item will be visible.

Filter


this.radDropDownList1.Filter = FilterItem;

Me.radDropDownList1.Filter = AddressOf FilterItem

Filtering predicate


private bool FilterItem(RadListDataItem item)
{
    if (item.Text.StartsWith("L"))
    {
        return true;
    }
    return false;
}

Private Function FilterItem(item As RadListDataItem) As Boolean
    If item.Text.StartsWith("L") Then
        Return True
    End If

    Return False
End Function

If you apply the above filter to a RadDropDownList that is bound to the Northwind.Customers table you will obtain the following result:

Figure 1: Filter

WinForms RadDropDownList Filter

Another option to filter the items is to specify the FilterExpression property.

FilteringExpression

this.radDropDownList1.FilterExpression = "Country LIKE 'Argentina'";

Me.radDropDownList1.FilterExpression = "Country LIKE 'Argentina'"

Figure 2: FilteringExpression

WinForms RadDropDownList FilteringExpression

The IsFilterActive property gets a value indicating whether there is a Filter or FilterExpression set.

In this article