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

How to auto complete a combined items with RadComboBox

4 Answers 77 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
L
Top achievements
Rank 1
L asked on 23 Nov 2011, 10:06 PM
I want to users to locate first name and last name, but telerik:TextSearch.TextPath can only set by one column. what can I do? Thanks.

Here is the code:
<telerik:RadComboBox x:Name="cbWorkers" ItemsSource="{Binding Source={StaticResource ViewModel},Path=DataModel.Workers}" 
                                                                     SelectedValuePath="idWorkerKey" Width="200"
                                                                     telerik:TextSearch.TextPath="firstName"
                                                    IsEditable="True" SelectedIndex="0">
                                                    <telerik:RadComboBox.ItemTemplate>
                                                        <DataTemplate>
                                                            <TextBlock>
                                                                <Run Text="{Binding firstName}"></Run>
                                                                <Run>,</Run>
                                                                <Run Text="{Binding lastName}"></Run>
                                                            </TextBlock>
                                                        </DataTemplate>
                                                    </telerik:RadComboBox.ItemTemplate>
                                                    <telerik:RadComboBox.SelectionBoxTemplate>
                                                        <DataTemplate>
                                                            <TextBlock>
                                                                <Run Text="{Binding firstName}"></Run>
                                                                <Run>,</Run>
                                                                <Run Text="{Binding lastName}"></Run>
                                                            </TextBlock>
                                                        </DataTemplate>
                                                    </telerik:RadComboBox.SelectionBoxTemplate>
                                                </telerik:RadComboBox>

4 Answers, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 24 Nov 2011, 08:33 AM
Hello,

You need to add a property in your data object that combines the properties and then set telerik:TextSearch.TextPath="the new property name".

Regards,
Valeri Hristov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
L
Top achievements
Rank 1
answered on 24 Nov 2011, 03:45 PM
Thanks. But there is still a question, when i use SelectionBoxTemplate and ItemTemplate, sometimes selecteditem doesn't works.
0
Valeri Hristov
Telerik team
answered on 25 Nov 2011, 03:34 PM
I don't understand the question, could you please provide more details?

Best wishes,
Valeri Hristov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
L
Top achievements
Rank 1
answered on 25 Nov 2011, 03:41 PM
Sorry, it's my fault, I made a mistake with the name of selecteditem.
Tags
ComboBox
Asked by
L
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
L
Top achievements
Rank 1
Share this question
or