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

Text search problem

3 Answers 104 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Miłosz Cechnicki
Top achievements
Rank 1
Miłosz Cechnicki asked on 27 Jan 2010, 02:21 PM
Hi,
I have a problem with Text search function in a ComboBox control.

The definition of the RadComboBox control, that does not support text search:
<telerikInput:RadComboBox x:Name="ctrlForm" SelectionChanged="ctrlForm_SelectionChanged" IsTextSearchEnabled="True">
                <telerikInput:RadComboBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding Form, Converter={StaticResource FormFieldConverter}}"/>
                    </DataTemplate>
                </telerikInput:RadComboBox.ItemTemplate>
            </telerikInput:RadComboBox>

However, very similiar definition is working properly:
<telerikInput:RadComboBox x:Name="ctrlForm" SelectionChanged="ctrlForm_SelectionChanged" IsTextSearchEnabled="True">
                <telerikInput:RadComboBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding .,}"/>
                    </DataTemplate>
                </telerikInput:RadComboBox.ItemTemplate>
            </telerikInput:RadComboBox>

Also binding to a property without using converter does not allow to use search.

Best reagards

3 Answers, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 27 Jan 2010, 07:57 PM
Hello MiƂosz,

TextSearch uses the DisplayMemberPath to determine which property should be used as Text. When you use ItemTemplate you should specify the Text property with the telerik:TextSearch.TextPath attached property, where the telerik namespace is declared as:

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

Greetings,
Valeri Hristov
the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Jared Smith
Top achievements
Rank 1
answered on 12 May 2010, 03:56 PM
Do you have any simple sample code showing how to implement this.  I'm confused how to use Attached properties.  Will this also work if both ItemTemplate and SelectionBoxTemplate are set.
0
Valeri Hristov
Telerik team
answered on 12 May 2010, 04:06 PM
Hello Jared,

Here is a online example, that demonstrates the different combinations of TextSearch.TextPath and ItemTemplate:
http://demos.telerik.com/silverlight/#ComboBox/DataBinding

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.
Tags
ComboBox
Asked by
Miłosz Cechnicki
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Jared Smith
Top achievements
Rank 1
Share this question
or