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

IsEditable, IsTextSearchEnabled, AutoComplete

6 Answers 458 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Giancarlo Aguilera
Top achievements
Rank 1
Giancarlo Aguilera asked on 20 Jan 2010, 04:01 PM
Hello,

I am using the RadComboBox. I have both IsEditable and IsTextSearchEnabled set to true. However as I type in the text of the control is not updated with the first matching item. As the user types in I need the text of the control to change to the first matching item, if any. Down below is my XAML. I believe this is possible but I believe I am missing something. Thank you



 

 

<telerik:RadComboBox

 

 

ItemsSource="{Binding States}"

 

 

SelectedItem="{Binding State, Mode=TwoWay}"

 

 

IsEnabled="{Binding IsEnabledCompanyDependency}"

 

 

Style="{StaticResource RadComboBoxStyle2}"

 

 

Width="50"

 

 

Margin="7,0,0,0"

 

 

/>

 

<

 

Style TargetType="telerik:RadComboBox" x:Key="RadComboBoxStyle2">

 

 

 

 

 

 

<Setter Property="HorizontalContentAlignment" Value="Left"/>

 

 

 

 

 

 

<Setter Property="HorizontalAlignment" Value="Left"/>

 

 

 

 

 

 

<Setter Property="Width" Value="200"/>

 

 

 

 

 

 

<Setter Property="Height" Value="25"/>

 

 

 

 

 

 

<Setter Property="IsEditable" Value="False"/>

 

 

 

 

 

 

<Setter Property="FilteringMode" Value="StartsWith"/>

 

 

 

 

 

 

</Style>

 

6 Answers, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 20 Jan 2010, 04:27 PM
Hi Giancarlo,

The Style you've pasted has the following setter:

<Setter Property="IsEditable" Value="False"/>

Probably this is the reason for the problem? Am I missing something?

Regards,
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
Giancarlo Aguilera
Top achievements
Rank 1
answered on 20 Jan 2010, 04:37 PM
Hi Valeri,

Thank you for the prompt response. Down below is the correct XAML for the control. I have IsEditable set at the control level. Please note that as I type in the corresponding item in the combo's drop down is in fact selected. If I open the drop down I see first matching item selected. The problem however is that the expectation here is that the first matching item's text will be reflected in the combo's text box. Thank you again

<telerik:RadComboBox 

 

ItemsSource="{Binding States}"  

SelectedItem="{Binding State, Mode=TwoWay}"
IsEditable="True" 

 

IsEnabled="{Binding IsEnabledCompanyDependency}"  

Style="{StaticResource RadComboBoxStyle2}"  

Width="50"  

Margin="7,0,0,0"  

/>




0
Giancarlo Aguilera
Top achievements
Rank 1
answered on 20 Jan 2010, 04:40 PM
Just to add a little more detail to what's happening. The combo box has the following items:

CA
AZ
WA

If I type in "A", then it is the case that if I open the drop down the "AZ" entry is in fact selected. However what users want is the value "AZ" to appear in combo's text box when "A" is typed in. Please let me know if the problem is not clear. Thank you
0
Valeri Hristov
Telerik team
answered on 20 Jan 2010, 07:33 PM
Hello Giancarlo,

I understand the problem now. It is related to the fact that RadComboBox disables its autocomplete when the filtering is enabled. Currently there is no way to use both autocomplete and filtering.

Regards,
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
Giancarlo Aguilera
Top achievements
Rank 1
answered on 20 Jan 2010, 07:43 PM
Thank you Valeri,

I was able to get pass this point. Below is the new style and Combo I am using. I no longer the issue I reported initially. The problem I am having now though is that if I click on the textbox portion of the combo, anywhere it is empty, the caret does not appear. I have to either click on the very beginning of the combobox if it is completely or otherwise if the combo has text I have to click somewhere inside the text. If the combobox is empty and I click halfway between it (horizontally), the caret does not show up at all, not even at the beginning. Any thoughts? I thought that by setting the OpenDropDownOnFocus to false might solve the issue but it did not. I am struggling spending way too much on such simple things. Thank you for all your help

<

 

Style TargetType="telerik:RadComboBox" x:Key="EditableRadComboBoxStyle">

 

 

 

<Setter Property="HorizontalContentAlignment" Value="Left"/>

 

 

 

<Setter Property="HorizontalAlignment" Value="Left"/>

 

 

 

<Setter Property="Width" Value="200"/>

 

 

 

<Setter Property="Height" Value="25"/>

 

 

 

<Setter Property="IsEditable" Value="True"/>

 

 

 

<!--<Setter Property="FilteringMode" Value="StartsWith"/>-->

 

 

 

</Style>

 

<

 

telerik:RadComboBox

 

 

Name="city"

 

 

OpenDropDownOnFocus="False"

 

 

 

 

 

ItemsSource="{Binding Cities}"

 

 

 

 

 

 

 

SelectedItem="{Binding City, Mode=TwoWay}"

 

 

IsEnabled="{Binding IsEnabledCompanyDependency}"

 

 

 

 

 

Style="{StaticResource EditableRadComboBoxStyle}"

 

 

 

 

 

Width="103"

 

 

 

 

 

Margin="7,0,0,0"

 

 

 

 

 

/>

 

0
Valeri Hristov
Telerik team
answered on 21 Jan 2010, 07:25 PM
Hi Giancarlo,

Do you use the latest version of RadComboBox? We used to have similar problems in the past, where the horizontal alignment of the ComboBox TextBox was not correct. I actually tried with the assemblies that will be released tomorrow as an internal build and was unable to reproduce the problem.

Regards,
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.
Tags
ComboBox
Asked by
Giancarlo Aguilera
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Giancarlo Aguilera
Top achievements
Rank 1
Share this question
or