ASPxTreeList.FilterExpression Property

Gets or sets the filter criterion which is applied to the tree list.

Namespace: DevExpress.Web.ASPxTreeList

Assembly: DevExpress.Web.ASPxTreeList.v19.2.dll

Declaration

[DefaultValue("")]
public string FilterExpression { get; set; }
<DefaultValue("")>
Public Property FilterExpression As String

Property Value

Type Default Description
String

String.Empty

A String value that specifies the filter criterion.

Remarks

Online Demo

ASPxTreeList - Filter Control

Examples

The following examples illustrate different scenarios on how to filter the tree list data.

  • Filtering data by dates.

    
    DateTime date1 = new DateTime(1995, 1, 1);
    DateTime date2 = new DateTime(1995, 7, 1);
    string filter = String.Format("[OrderDate] > #{0}# And [OrderDate] < #{1}#",
                        date1.ToShortDateString(), date2.ToShortDateString());
    ASPxTreeList1.FilterExpression = filter;
    
  • Applying a filter that selects orders shipped to Albuquerque (USA). The filter criteria are displayed within the ASPxTreeList's title.

    
    ASPxTreeList1.FilterExpression = "[Country] = 'USA' AND [UnitPrice] > 50";
    ASPxTreeList1.Caption = ASPxTreeList1.FilterExpression;
    

    Result:

    ASPxTreeList-FilterExpression

See Also