How to auto complete a combined items with RadComboBox

5 posts, 0 answers
  1. L
    L avatar
    11 posts
    Member since:
    Nov 2011

    Posted 23 Nov 2011 Link to this post

    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>
  2. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 24 Nov 2011 Link to this post

    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 >>

  3. DevCraft banner
  4. L
    L avatar
    11 posts
    Member since:
    Nov 2011

    Posted 24 Nov 2011 Link to this post

    Thanks. But there is still a question, when i use SelectionBoxTemplate and ItemTemplate, sometimes selecteditem doesn't works.
  5. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 25 Nov 2011 Link to this post

    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 >>
  6. L
    L avatar
    11 posts
    Member since:
    Nov 2011

    Posted 25 Nov 2011 Link to this post

    Sorry, it's my fault, I made a mistake with the name of selecteditem.
Back to Top
DevCraft banner