TreeList.AddFilter(String) Method
Adds a predefined filter with a string filtering condition to the current TreeList.
Namespace: DevExpress.XtraTreeList
Assembly: DevExpress.XtraTreeList.v24.1.dll
NuGet Packages: DevExpress.Win.Navigation, DevExpress.Win.TreeList
Declaration
Parameters
Name | Type | Description |
---|---|---|
filterString | String | A String value that is the filtering condition. |
Remarks
You can manually define a filter and add it to your TreeList control. The filterString parameter should be an exact filtering query. If a column’s TreeListColumn.FieldName or a filter condition is written incorrectly, the filtering will not occur. Below is an example of adding a filter via the AddFilter method:
private void cmdFindRoot_Click(object sender, EventArgs e) {
treeList1.AddFilter("[Node Name] = 'Root Node' And [Value] = 'A' And [Node Description] <> 'Secondary node'");
}
You can also define a CriteriaOperator object and pass it to the TreeList.AddFilter method. See the method overload list to learn more.