Filter tree view by first level only, but still be able to expand

Grids for WPF Forum

Posted 3 years ago by Brian Pratt
Version: 20.1.1

I have a tree

  • a
    • x.1
    • x.2
    • x.3
      • y.1.1
      • y.1.2
  • b
    • z.1
      • t.1
    • z.2
  • c
    • w.1
      • g.1.1
      • g.1.2

I want to have a text box filter at the top of the tree that when you type "b" in, it only shows the first level "b" as a result, but also allows you to expand b to see its children (all of them, not filtered).  The customer is only interested in searching the root level, but is very interested seeing all the children of the filtered root.  Is this possible?

Typing in 'b' in the search would display 

  • b

Then Expanding b would display all children of b

  • b
    • z.1
      • t.1
    • z.2

Comments (1)

Answer - Posted 3 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Brian,

Yes check out the "Actipro Grids / Tree Control Features / Filtering" topic in the documentation that comes with the product.  There is an DataFilterResult.IncludedWithDescendants result that can be returned by the filter logic for an item it examines.  You'd want to have your filter return that for the root level items that match your filter logic.

The Filtering QuickStart can show this if you set the "Included filter result" to "IncludedWithDescendants", set "Value" to "North", and check the "Is filter active" checkbox.

Actipro Software Support

The latest build of this product (v24.1.2) was released 28 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.