Profile Picture

How to apply Filter in NTreeViewEx

Posted By Tobias Breuer 9 Years Ago
Author
Message
Tobias Breuer
Question Posted 9 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: Forum Members
Last Active: 9 Years Ago
Posts: 5, Visits: 11
Hi, I'm currently struggling with filtering an NTreeViewEx based on the Name / Text of the NTreeNodes contained in the TreeView. What I'm currently doing is: I have a TextBox where I listen for text changes (buffered to update only every 500 ms). When the buffering time is elapsed, I want to apply the filter and list only those nodes, that contain the given filter text.

To achieve this, I create a new NTreeNodeTextFilter and set this to the VisibleFilter property of the NTreeViewEx. The options are CommonStringOptions.Contains and case match is set to false.
Sometimes, this filter seems to do something (e.g. when I enter 't' it lists some nodes that actually contain a t but not all - when I extend the filter to 'ti' it does not find anything even though there are nodes with this text. Setting it back to 't' now also does not list any items any more. Not even those he found before).

I actually tried a lot of different approaches without any luck:
- Create a new NTreeNodeTextFilter every time the search text changed
- keep the same instance of NTreeNodeTextFilter and only update its Text property
- calling ForceUpdate on the TreeViewEx after applying the filter
- using NTreeNodeNameFilter instead.
- applying the filter to the Nodes collection of the NTreeViewEx -> this will result in no items showing up ever

Btw: I'm using Nevron version 13.5.15
Can you please provide a basic example on how to Filter the NTreeViewEx to show only those nodes that in their Text contain a given search string?

Thanks in advance and best regards,

Tobias




Similar Topics


Reading This Topic