Auto Complete Session: programmatically toggle filter

SyntaxEditor for WPF Forum

Posted 9 years ago by tal
Version: 14.2.0611
Avatar

Hey,
We are experimenting with the completion list feature.
We are filtering into several categories (words that begins with letters and words that begins with numbers) and hiding one of them by default (numberFilter.IsActive=False). We would like to toggle this filter and automatically enable it when the user starts typing a number as the first letter in the current auto complete session (and it should be kept enabled until the end of this session).
Is there a way to do that?
Thanks!

Comments (3)

Posted 9 years ago by tal
Avatar

By the way, when we type anything (a single char, for example 'a') and then delete it,

the list is repopulated with items that have been filtered out by the disabled group (though that group is still not toggled).

Is this the expected behaviour?

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

You have access to the session's Filters collection at any time.  So if you override OnViewTextInput in a CompletionSession-derived class, you could look at the TypedText property to see what text has been typed thus far by the end user and alter the filters as needed.

For the second question, please tell us how to repro this in one of our samples or email us a new simple project that shows it happening so we can debug it.  In your email, reference this thread and be sure to rename the .zip file extension of what you send so it doesn't get spam blocked.  Thanks!


Actipro Software Support

Posted 9 years ago by tal
Avatar

Hi,

First of all, thanks for the fast reply.

Second, we managed to solve the second problem by switching to OnKeyDown.

Currently the state of the filter does change (and shows up the previously filtered out items) but its icon remains unselected, though we changed its IsActive state to true.

We sent you a small sample project.
Thanks again!

The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.