# Angular TreeList Filtering Basics

The [Angular TreeList](https://www.telerik.com/kendo-angular-ui/components/treelist) filtering feature enables you to display only those TreeList records that meet specific filter criteria.

You can enable the filtering feature by using two methods:

* [The Data-Binding Directives](https://www.telerik.com/kendo-angular-ui/components/treelist/filtering/basics#using-the-built-in-directives)—Allow you to implement filtering (or other [data operations](https://www.telerik.com/kendo-angular-ui/components/treelist/data-operations)) with less code.
* [Manual Filtering](https://www.telerik.com/kendo-angular-ui/components/treelist/filtering/manual-filtering)—Provides more control when implementing the filtering feature.

## Using the Built-in Directives

The [`kendoTreeListFlatBinding`](https://www.telerik.com/kendo-angular-ui/components/treelist/api/flatbindingdirective) directive performs filtering automatically.

The following example demonstrates how to enable filtering using the `kendoTreeListFlatBinding` directive.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/treelist/filtering/basics/source.txt)

To enable the built-in TreeList filtering:

1. Set the TreeList [`filterable`](https://www.telerik.com/kendo-angular-ui/components/treelist/api/treelistcomponent#filterable) option to `true`.
2. (Optional) Set the [`filter`](https://www.telerik.com/kendo-angular-ui/components/treelist/api/treelistcomponent#filter) property to a [`CompositeFilterDescriptor`](https://www.telerik.com/kendo-angular-ui/components/data-query/api/compositefilterdescriptor) object. This allows you to filter the data by specific criteria during the initialization of the TreeList.

> To use the built-in filtering functionality of the TreeList with hierarchical data, use the [`kendoTreeListHierarchyBinding`](https://www.telerik.com/kendo-angular-ui/components/treelist/api/hierarchybindingdirective) directive and set the TreeList [`filterable`](https://www.telerik.com/kendo-angular-ui/components/treelist/api/treelistcomponent#filterable) option to `true`.

```html
<kendo-treelist
    [kendoTreeListFlatBinding]="data"
    [filterable]="true"
    ...
>
    ...
</kendo-treelist>
```

> To learn more about the data binding directives and to understand how it works under the hood, see the [data operations with the DataBinding directives](https://www.telerik.com/kendo-angular-ui/components/treelist/data-operations#automatic-data-processing) article.

## Filter Modes

The TreeList supports three filtering modes that display different filtering UIs.

| Mode                                                                                                      | Setup                                                                                                                                             | Description                                                                                                                |
| --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| [Filter row](https://www.telerik.com/kendo-angular-ui/components/treelist/filtering/filter-row) (default) | Set the [`filterable`](https://www.telerik.com/kendo-angular-ui/components/treelist/api/treelistcomponent#filterable) option to `true` or `'row'` | Filter controls are rendered below each column header cell. The data is filtered automatically once the user stops typing. |
| [Filter menu](https://www.telerik.com/kendo-angular-ui/components/treelist/filtering/filter-menu)         | Set the [`filterable`](https://www.telerik.com/kendo-angular-ui/components/treelist/api/treelistcomponent#filterable) option to `'menu'`.         | A filter icon appears inside the column header. The data is filtered when the user clicks the **Filter** button.           |
| Filter menu-row                                                                                           | Set the [`filterable`](https://www.telerik.com/kendo-angular-ui/components/treelist/api/treelistcomponent#filterable) option to `'menu, row'`.    | A combination of a filter menu and filter row.                                                                             |

The following example demonstrates the available filter modes of the TreeList.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/treelist/filtering/modes/source.txt)

## Filter Data Types

In its column filters, the TreeList provides a built-in filtering UI for all basic data types (`string`, `number`, `Date`, `boolean`). You can set the filtering UI type through the [filter](https://www.telerik.com/kendo-angular-ui/components/treelist/api/columncomponent#filter) input property of each column.

### Text Filter

The text filter is the default filter type. Its UI is a [`TextBox`](https://www.telerik.com/kendo-angular-ui/components/inputs/textbox) component.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/treelist/filtering/filter-types/text/source.txt)

### Numeric Filter

The numeric filtering UI is a [`NumericTextBox`](https://www.telerik.com/kendo-angular-ui/components/inputs/numerictextbox) component.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/treelist/filtering/filter-types/number/source.txt)

### Date Filter

The date filtering UI is the [`DatePicker`](https://www.telerik.com/kendo-angular-ui/components/dateinputs/datepicker) component.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/treelist/filtering/filter-types/date/source.txt)

### Boolean Filter

The boolean filtering UI utilizes the [`DropDownList`](https://www.telerik.com/kendo-angular-ui/components/dropdowns/dropdownlist) component.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/treelist/filtering/filter-types/boolean/source.txt)

## Suggested Links

* [FilterDescriptors](https://www.telerik.com/kendo-angular-ui/components/data-query/api/filterdescriptor)
* [dataStateChange](https://www.telerik.com/kendo-angular-ui/components/treelist/api/treelistcomponent#datastatechange)
* [Built-In Filter Row Templates](https://www.telerik.com/kendo-angular-ui/components/treelist/filtering/filter-row)
* [Built-In Filter Menu Templates](https://www.telerik.com/kendo-angular-ui/components/treelist/filtering/filter-menu)
* [Reusable Custom Filter Components](https://www.telerik.com/kendo-angular-ui/components/treelist/filtering/filter-row#custom-filter-row-components).
* [API Reference of the TreeListComponent](https://www.telerik.com/kendo-angular-ui/components/treelist/api/treelistcomponent)
* [Data Binding Basics](https://www.telerik.com/kendo-angular-ui/components/treelist/data-binding/basics)
