Skip to main content

How to: Dynamically Show and Hide Specific Nodes

The example below ensures that Tree List records with the 15% discount are always visible, regardless of the currently applied filtering condition.

TreeList - Custom Filter

private void TreeList1_CustomRowFilter(object sender, CustomRowFilterEventArgs e) {
    TreeList treeList = sender as TreeList;
    string discount = treeList.GetRowCellDisplayText(e.Node, treeList.Columns["Discount"]);
    if (discount == "15%") {
        e.Visible = true;
        e.Handled = true;
    }
}