filter="contains" filters out separator

2 posts, 0 answers
  1. John
    John avatar
    6 posts
    Member since:
    May 2012

    Posted 20 Jun 2014 Link to this post

    I have a combo box that is loading its data from a webservice. When the user types in some letters the webservice uses these as a filter and returns only rows that match (using a "contains" sql call). This all works well.

    I have also set "filter=contains" on the combobox so that the matching part of the filter is highlighted in the dropdown list. This looks very nice.

    However, if the webservice finds no items because the filter eliminates all data (maybe the user types in ZZZZZ) then the webservice returns a single radcombobox item with value="" and text="Sorry, no match found". I also mark this item with "IsSeparator = True" so that I can style it appropriately on the client.

    The problem is that the "filter=contains" filters out the "Sorry, no match found" item because it doesn't match the text "ZZZZZ"! So the user never sees my friendly message, they just get an empty dropdownlist.

    If I turn off the filter=contains then the friendly message shows, but obviously I lose the highlighting in the dropdown to show how the user's input is matching up with the items in the list.

    Is there a way to make the client-side "filter=contains" filter out everything except a certain item, or everything except separators?
  2. Helen
    Helen avatar
    1052 posts

    Posted 24 Jun 2014 Link to this post

    Hello John,

    Did you try to use the "ShowMoreResultsBox"  property of RadComboBox like in the example:

    It shows "No matches" if there are not items in dropdown.


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top