How to set/do AutoComplete on ItemTemplate

8 posts, 1 answers
  1. Jon
    Jon avatar
    539 posts
    Member since:
    Apr 2004

    Posted 19 Feb 2010 Link to this post

    Hi.. again...
    How do I enable AutoComplete on an ItemTemplate.... for example I want to enable autocomplete in the demos
    on DealerCombox..   you have AutoComplete working on the  other samples.... Models, Country....
    thanks again!!!!!!!!!!!!!!!!!!!!!
  2. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 22 Feb 2010 Link to this post

    You need to set the TextSearch.TextPath attached property on RadComboBox to specify the member that should be used as Text property when the control searches its items. The following example demonstrates how to do it:
    http://demos.telerik.com/silverlight/#ComboBox/DataBinding

    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Jon
    Jon avatar
    539 posts
    Member since:
    Apr 2004

    Posted 25 Feb 2010 Link to this post

    HI...
    It does not work on an ItemTemplate in the following example.  Any ideas way?   thanks again

     

     

    <telerikPresentation:RadComboBox TabIndex="4" Height="54" Name="cmbCustomer" IsReadOnly="True" IsEditable="True" TextSearch.TextPath="cust_name" Style="{StaticResource requiredFieldValidationStyle}" SelectedIndex="0" SelectedItem="{Binding cust_name, Mode=TwoWay}" SelectedValue="{Binding Path=cust_name}" SelectedValuePath="cust_name" Width="332" GotFocus="cmbCustomer_GotFocus">

     

     

     

    <telerikPresentation:RadComboBox.Effect>

     

     

     

    <DropShadowEffect BlurRadius="0" ShadowDepth="2" />

     

     

     

    </telerikPresentation:RadComboBox.Effect>

     

     

     

    <telerikPresentation:RadComboBox.ItemTemplate>

     

     

     

    <DataTemplate>

     

     

     

    <Grid Margin="5" Width="300">

     

     

     

    <Grid.ColumnDefinitions>

     

     

     

    <ColumnDefinition />

     

     

     

    <ColumnDefinition />

     

     

     

    <ColumnDefinition />

     

     

     

    </Grid.ColumnDefinitions>

     

     

     

    <Grid.RowDefinitions>

     

     

     

    <RowDefinition />

     

     

     

    <RowDefinition />

     

     

     

    <RowDefinition />

     

     

     

    </Grid.RowDefinitions>

     

     

     

    <TextBlock FontWeight="Bold" x:Name="txtCUST_NAME" Grid.ColumnSpan="2" Text="{Binding cust_name}" />

     

     

     

    <TextBlock Foreground="Navy" Grid.ColumnSpan="3" Grid.Row="1" Margin="10,0,0,0" Text="{Binding address}" />

     

     

     

    <TextBlock Foreground="Navy" Grid.Column="0" Grid.Row="2" Margin="10,0,0,0" Text="{Binding city}" />

     

     

     

    <TextBlock Foreground="Navy" Grid.Column="1" Grid.Row="2" Margin="0" Text="{Binding state}" />

     

     

     

    <TextBlock Foreground="Navy" Grid.Column="2" Grid.Row="2" Margin="-20,0,0,0" Text="{Binding zipcode}" />

     

     

     

    </Grid>

     

     

     

    </DataTemplate>

     

     

     

    </telerikPresentation:RadComboBox.ItemTemplate>

     

     

     

    </telerikPresentation:RadComboBox>

     

  5. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 26 Feb 2010 Link to this post

    Hi Jon,

    As I replied in your other forum thread, the problem comes from the usage of the WPF TextSearch.TextPath attached property. If you use telerik:TextSarch.TextPath the problem will disappear.

    Regards,
    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.
  6. Jon
    Jon avatar
    539 posts
    Member since:
    Apr 2004

    Posted 26 Feb 2010 Link to this post

    HI..
    But if you set IsEditable = 'true' the ItemTemplate does not display. You just get a 'textbox' to enter.
    How can I also show the template?  with the multiple lines in the combo box and have autocomplete work?
    thanks
  7. Answer
    Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 26 Feb 2010 Link to this post

    Hello Jon,

    I cannot understand what are you trying to achieve - do you want to have an editable combobox with "rich" items (with ItemTemplate), or you need not editable combobox with ItemTemplate, that allows the user to select items by typing their text?

    When RadComboBox is editable (IsEditable=true) it displays only a TextBox in its selection box. You control the value of the property that will be displayed in this TextBox with the telerik:TextSearch.TextPath attached property. When RadComboBox is not editable (IsEditable=false) it displays the ItemTemplate in its selection box. You control which property to be used to auto select items with the telerik:TextSearch.TextPath property. The example that I've sent earlier demonstrates all supported scenarios (it is Silverlight, but the WPF syntax is exactly the same).

    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.
  8. Jon
    Jon avatar
    539 posts
    Member since:
    Apr 2004

    Posted 26 Feb 2010 Link to this post

    thanks for the clarification...
    I hoping that when ' RadComboBox is editable (IsEditable=true) it displays only a TextBox in its selection box'
    that it would display more than just a textbox... maybe display the template and have those other controls editable... instead of just a single Textbox.    thanks...




  9. Mariusz
    Mariusz avatar
    26 posts
    Member since:
    Jul 2011

    Posted 26 Jul 2012 Link to this post

    It's good idea. If combobox is focuesd it should display TextBox to Autocomplette. When combobox focus lost it should display ItemTemplate
Back to Top
UI for WPF is Visual Studio 2017 Ready