You have several options, in my opinion:
- Use an available component/library implementing such a functionality
or
Keep the original TreeView hidden and generate each time a new (visible) TreeView with filtered data.
or
Define your Tree data structure with filtering functionality and use the filtered data to populate a TreeView.