Skip to main content
All docs
V18.2

How to: Hide specific nodes using filter conditions

Important

This example targets version 16.2 and older.

The example applies filter conditions that hide rows that contain “San Francisco” or “Toronto “in the colLOCATION column. The filter conditions are created using the TreeList.FilterConditions property.

By default, filtering is disabled in version 16.2 and older. The TreeListOptionsBehavior.EnableFiltering property needs to be set to true to enable filtering.

using DevExpress.XtraTreeList;

treeList1.OptionsBehavior.EnableFiltering = true;
FilterCondition fc = new FilterCondition(FilterConditionEnum.Equals, colLOCATION, "San Francisco");
FilterCondition fc1 = new FilterCondition(FilterConditionEnum.Equals, colLOCATION, "Toronto");
treeList1.FilterConditions.Add(fc);
treeList1.FilterConditions.Add(fc1);