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?