New to Telerik UI for WinFormsStart a free 30-day trial

Filtering

Updated over 1 year ago

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

C#
            
this.radDropDownList1.Filter = FilterItem;

Filtering predicate

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

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

C#
this.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.

Not finding the help you need?
Contact Support