Text search problem

4 posts, 0 answers
  1. Miłosz Cechnicki
    Miłosz Cechnicki avatar
    34 posts
    Member since:
    Sep 2009

    Posted 27 Jan 2010 Link to this post

    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

  2. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 27 Jan 2010 Link to this post

    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.
  3. DevCraft banner
  4. Jared Smith
    Jared Smith avatar
    5 posts
    Member since:
    Mar 2004

    Posted 12 May 2010 Link to this post

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

    Posted 12 May 2010 Link to this post

    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.
Back to Top