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

search complex displaymember

3 Answers 55 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Tim Ge
Top achievements
Rank 1
Tim Ge asked on 18 May 2010, 03:34 AM

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.

3 Answers, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 18 May 2010, 07:58 AM
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.
0
Tim Ge
Top achievements
Rank 1
answered on 19 May 2010, 10:59 PM
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?
0
Valeri Hristov
Telerik team
answered on 20 May 2010, 08:08 AM
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.
Tags
ComboBox
Asked by
Tim Ge
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Tim Ge
Top achievements
Rank 1
Share this question
or