Home Forums WPF controls Xceed Toolkit Plus for WPF WatermarkComboBox auto filtering / searching

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • scottlafoy
    Participant
    Post count: 1
    #45002 |

    I am using the WatermarkComboBox and when I have the item source hooked up so I can type in the combo box and it will filter the list as I type.

    The problem I am having is it seems to be doing the filtering on the start of the string and I would like to do it on if the string contains what I’m typing.

    For example:
    With a list of:
    DOMAIN\Doug
    DOMAIN\Bob
    DOMAIN\Kevin

    When I start typing “Ke” it does not match to anything, and I would like it to match “DOMAIN\Kevin”

    My usage:

                            <xctk:WatermarkComboBox Watermark="DOMAIN\USERNAME" IsEditable="True"
                            VerticalAlignment="Center" HorizontalAlignment="Center" Width="150"
                            Text="{Binding UserName, UpdateSourceTrigger=PropertyChanged}"
                            SelectedItem="{Binding UserName}"
                            ItemsSource="{Binding UserList }"/>

    Thank you for any help on this matter.

    Fawzi [Xceed]
    Member
    Post count: 722

    Hi,

    The WatermarkComboBox derives from the ComboBox and adds a watermark. So the filtering “Starts With” is the same as the one in the standard comboBox.

    If you want to use the WatermarkComboBox and use a “Contains” filter instead of a “Starts With” filter, you will have to derive from ComboBox (or WatermarkComboBox) and add the necessary to filter the way you want. Here are people trying to do so :
    -http://dotbay.blogspot.ca/2009/04/building-filtered-combobox-for-wpf.html
    -http://jacobmsaylor.com/wpf-filtering-a-combobox/

    Please note that the toolkit also offers a TokenizedTextBox with filtering as you type. You can test it in the sample “Input Fields/Text/Tokenized TextBox” of the LiveExplorer of the Toolkit available here : https://xceed.com/xceed-toolkit-plus-for-wpf/.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.