This is a migrated thread and some comments may be shown as answers.

Contains vs StartsWith and autocompletion

1 Answer 151 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 25 Aug 2014, 12:30 PM
HI.

In the following example, I use a RadComboBox with TextSearchMode="Startswith".

<telerik:RadComboBox  
                        ItemsSource="{Binding RelativeSource={RelativeSource FindAncestor,  AncestorType={x:Type UserControl}},Path=DataContext.Sagsbehandler}" 
                        SelectedValue="{Binding SagsbehandlerId, ValidatesOnDataErrors=True, UpdateSourceTrigger=LostFocus}" 
                        SelectedValuePath="SagsbehandlerId"
                        DisplayMemberPath="Navn"                    
                        IsEditable="True"
                        TextSearchMode="StartsWith"
                        >
When typing the first letters of an item in the itemssource, the first match is selected/autocompleted in the editable area.

However: If I change TextSearchMode to "Contains", there is no autocompletion as I initially would have expected. Only the typed text is shown and the user has no clue if the typed text has any match in the itemssource.
How can I change this behaviour? That is, how can I enable autocompletion when using a contains search.


1 Answer, 1 is accepted

Sort by
0
Alek
Telerik team
answered on 27 Aug 2014, 08:01 AM
Hi Thomas,

In the current implementation of the control you cannot apply the append functionality with TextSearchMode set to "Contains". If we add a text before the typed symbol it will affect the Search functionality of the control and in many cases the result will be not relevant. 

There is another of our controls which can be suitable for your purposes - RadAutoCompleteBox. The autocompletion in "Contains" mode will still not work as you are expecting but there is a dropdown where the filtering can be seen. In the link pasted below you can find an example showing how to equip the control with a dropdown button so it will be more like RadComboBox. Please, take a look at it - 

https://github.com/telerik/xaml-sdk/tree/master/AutoCompleteBox/OpenWithDropDownButton

We hope that the proposed solution will be suitable for your project. 

Regards,
Alek
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
ComboBox
Asked by
Thomas
Top achievements
Rank 1
Answers by
Alek
Telerik team
Share this question
or