Gets or sets the filter criterion which is applied to the tree list.
Namespace: DevExpress.Web.ASPxTreeList
Assembly: DevExpress.Web.ASPxTreeList.v19.2.dll
[DefaultValue("")]
public string FilterExpression { get; set; }
<DefaultValue("")>
Public Property FilterExpression As String
Type | Default | Description |
---|---|---|
String | A String value that specifies the filter criterion. |
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: