FilterMemberProvider func not called

3 posts, 1 answers
  1. Carol
    Carol avatar
    2 posts
    Member since:
    Jun 2012

    Posted 16 Apr 2015 Link to this post

    I am trying to get the RadAutoCompleteBox to provide an unfiltered list in certain scenarios, such as when the control initially gets the focus and the current value is not in the list.  I am experimenting with the FilterMemberProvider, and it's not working as I expected.

     Just for testing purposes, I have the following code in my custom control derived from RadAutoCompleteBox:

                this.FilterMemberProvider = CustomFilterBehavior;


             public string CustomFilterBehavior(object obj)
                return "Test";  

                // actual intention is to return this.Text in certain scenarios to prevent filtering,

               // and normal filter value in other scenarios

    This test code has not changed the behavior of my control at all -- it still filters normally.  I put a breakpoint in the CustomFilterBehavior method, and see that it is never called.  I have tried setting the FilterMemberBehavior in the constructor of my control or in OnLoaded; and get the same result.

    Is there something else I need to do to use the FilterMemberProvider?

    Or is there a better way to force the suggestions control to show an unfiltered list in certain scenarios?





  2. Answer
    Rosy Topchiyska
    Rosy Topchiyska avatar
    547 posts

    Posted 20 Apr 2015 Link to this post

    Hello Carol,

    Thank you for contacting us.

    There are two problems with your scenario. The first problem is that FilterMemberProvider is called once per item and after that the provided value is used. The second problem: when you clear the content of the TextBox, the suggestions list is empty.

    To change the default filtering behavior, you will have to create your own text search provider by implementing the ITextSearchProvider interface and then call the RadAutoCompleteBox.InitializeSuggestionsProvider() method with your provider as a parameter.

    You can use the RadAutoCompleteBox.IsDropDownOpen property to display the suggestions list.
    I hope this helps. Please, let us know if you have further questions.

    Rosy Topchiyska

    See What's Next in App Development. Register for TelerikNEXT.

  3. Carol
    Carol avatar
    2 posts
    Member since:
    Jun 2012

    Posted 20 Apr 2015 in reply to Rosy Topchiyska Link to this post

    Thank you for pointing me in the right direction.
Back to Top