Filtering in Code

This topic provides information on filtering ASPxTreeList data programmatically.

In code, you can apply filters to all or individual columns. To filter grid data by an individual column, use the following methods.

To provide complex filter criteria (filtering data by multiple columns), specify the filter expression and assign it to the ASPxTreeList.FilterExpression property.

ASPxTreeList.FilterExpression="End_Date > 2017-09-15";

Setting the ASPxTreeList.FilterExpression property to an empty string clears the filter expression applied to the ASPxTreeList.

ASPxTreeList2.FilterExpression = String.Empty;

Example

The following code applies a filter that selects orders where the Country is "USA" and the Unit Price is greater than "250". The image below shows the result.

ASPxTreeList-ComplexCriteria

ASPxTreeList1.FilterExpression = "[Country] = 'USA' AND [UnitPrice] > 250";
See Also