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

How to set/do AutoComplete on ItemTemplate

7 Answers 300 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 20 Feb 2010, 02:52 AM
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!!!!!!!!!!!!!!!!!!!!!

7 Answers, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 22 Feb 2010, 10:24 AM
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.
0
Jon
Top achievements
Rank 1
answered on 25 Feb 2010, 11:08 PM
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>

 

0
Valeri Hristov
Telerik team
answered on 26 Feb 2010, 09:34 AM
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.
0
Jon
Top achievements
Rank 1
answered on 26 Feb 2010, 12:05 PM
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
0
Accepted
Valeri Hristov
Telerik team
answered on 26 Feb 2010, 12:20 PM
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.
0
Jon
Top achievements
Rank 1
answered on 26 Feb 2010, 01:18 PM
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...




0
Mariusz
Top achievements
Rank 1
answered on 26 Jul 2012, 09:44 AM
It's good idea. If combobox is focuesd it should display TextBox to Autocomplette. When combobox focus lost it should display ItemTemplate
Tags
ComboBox
Asked by
Jon
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Jon
Top achievements
Rank 1
Mariusz
Top achievements
Rank 1
Share this question
or