search complex displaymember

4 posts, 0 answers
  1. Tim Ge
    Tim Ge avatar
    16 posts
    Member since:
    May 2010

    Posted 17 May 2010 Link to this post

    i have got a combobox which has set the RadComboBox.ItemTemplate to a combined string

     

    <telerik:RadComboBox x:Name ="blah" HorizontalAlignment="Left" Margin="0,26.04,0,0" VerticalAlignment="Top" Width="167.54" d:LayoutOverrides="HorizontalAlignment" ItemsSource="{Binding Source={StaticResource respondentViewSource}}" >

    so how can i have a search text area that actually searches the "displaymember" or "itemtemplate"
    i think it's to do with telerik:TextSearch.TextPath, but i don't what value is expected in that attribute.

  2. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 18 May 2010 Link to this post

    Hello Tim,

    You need to set the TextSearch.TextPath attached property, check the following example for more information:
    http://demos.telerik.com/silverlight/#ComboBox/DataBinding

    If you are using Silverlight 3, the telerik xmlns should be declared as:

    xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"



    Greetings,
    Valeri Hristov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Tim Ge
    Tim Ge avatar
    16 posts
    Member since:
    May 2010

    Posted 19 May 2010 Link to this post

    Thanks for the reply.
    However, even I added a datatemplate, I can only search one element of them
    e.g.
                            <StackPanel.Resources>
                                <DataTemplate x:Key="ComboBoxSimpleTemplate">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Text="{Binding FirstName}" />
                                        <TextBlock Text=" " />
                                        <TextBlock Text="{Binding LastName}" />
                                    </StackPanel>
                                </DataTemplate>
                            </StackPanel.Resources>

    now I can only search FirstName or LastName, how can i achieve searching for fullname giving that i dont have fullname column in my database?
  5. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 20 May 2010 Link to this post

    Hi Tim,

    You should create an additional property, that combines the values of the members you need to search for, then set TextSearch.TextPath="the name of the new property". Probably you should also set TextSearchMode="Contains" on RadComboBox.

    Sincerely yours,
    Valeri Hristov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top