I'm using the TreeListBox control in my application and I have question about the AutoExpandItemsOnFilter property and the usage of filtering. When AutoExpandItemsOnFilter is True, I noticed that the found nodes will automatically expand all of it's children recursively, on top of expanding ancester nodes to make the found node visible. However, our application can contain a lot of nested child elements in each nodes and we would like to prevent exposing the children to avoid polluting the view, and let the users expand the Child nodes they're interested to see.
To better visualize what l mean: using your TreeListBoxFiltering set the following:
IsFilterActive = true
NameFilter = "Canada"
Operation = Contains
IncludedResuts = IncludedWithDescend
AutoExpandItemsOnFilter = true
If you collapse the Canada node to hide the provinces and play with the Name filter string by removing some characters, the Canada node keeps expanding to expose the provinces. However, we wish to keep nodes that were found collapsed, and only expand the ancester nodes leading to the found node. It's more obvious if you search for "North America" and see all child nodes expanded, included the nodes with children.
I re-read the documentation file and search in the Grids forum, but haven't found what I needed. I was thinking of a stategy of not using AutoExpandItemsOnFilter and instead do the expanding of it's parent nodes in the Filter method of my StringFilter, just before returning IncludedWithDescendants on the found node. However, when AutoExpandItemsOnFilter is false, I lose the important feature of restoring the view pre-filtering, when IsFilterActive is set to false (which will be the case in my application when search box is cleared).
Can you advise on the best course of action?
Thank you very much,