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

Pressing escape causes text to be highlighted on next key press

3 Answers 78 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Christopher
Top achievements
Rank 1
Christopher asked on 12 Sep 2013, 09:50 AM
Hi,

I am using the IsFilteringEnabled functionality in the RadComboBox control to allow our users to filter on a list of items as they type.
I have hooked up the KeyDown event in the code behind to set the IsDropDownOpen to true so the user can see the filtered items when they type. The functionality works well apart from an unexpected side effect:

1. click in the combo box text box and start typing e.g. bb
2. the drop down expands and shows available items matching bb as the user types
3. press ESC button and the drop down closes and the cursor remains at the end of the bb text in the text box.
4. when the user continues to type to add c at the end i.e. bbc I would expect the list of items to show only those containing bbc text. What actually happens is that the text bb is automatically highlighted and when the user types c the letters bb are erased and filter searches for items containing the letter c. This is unexpected.

I would like stop this automatic text highlighting on a subsequent key press after pressing escape otherwise users will need to start their filter search from the beginning which is unnatural.

Thanks,

Chris

XAML

 <telerik:RadComboBox x:Name="comboBoxCpty"  Grid.Row="0" Grid.Column="1" ItemsSource="{Binding CptyList}" 
                  IsFilteringEnabled="True"                  
                  IsEditable="True"  
                  TextSearchMode="Contains"
                  SelectedValuePath="CptyCode" 
                  DisplayMemberPath="Description"
                  SelectedValue="CptyCode"                  
                  KeyDown="ComboBoxCpty_OnKeyDown">
            <telerik:RadComboBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <VirtualizingStackPanel />
                </ItemsPanelTemplate>
            </telerik:RadComboBox.ItemsPanel>
        </telerik:RadComboBox>

Code Behind
private void ComboBoxCpty_OnKeyDown (object sender, KeyEventArgs e)
        {            
            comboBoxCounterparty.IsDropDownOpen = true;
        }

3 Answers, 1 is accepted

Sort by
0
Rosen Vladimirov
Telerik team
answered on 17 Sep 2013, 07:59 AM
Hi Christopher,

In order to support this scenario we have added new control - RadAutoCompleteBox. You can find more information about it in our documentation. Also I recommend you to take a look at our SDK Examples and particularly the NoMatchFilteringBehavior and OpenWithDropDownButton examples. I've used both of them to prepare a sample project for you, please find it attached and inform us in case you have any problems or concerns.

Hopefully this helps.

Regards,
Rosen Vladimirov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Chai Avisar
Top achievements
Rank 1
answered on 16 Feb 2014, 08:06 AM
Hi.
I am using RasAutoCompleteBox, and am experiencing a related problem.
After typing the first letter in the text box, the letter appears highlighted.
Typing the next letter, overwrites that first letter.
How do I avoid the first letter being highlighted?
Thank you,
Dina Mann
0
Rosen Vladimirov
Telerik team
answered on 19 Feb 2014, 10:45 AM
Hi Dina Mann,

I've tried to reproduce the issue, but without success. Could you give us more details on your scenario and RadAutoCompleteBox configuration? It will be great if you can open a new support thread and send us a sample project reproducing the issue.

I'm looking forward to hearing from you.

Regards,
Rosen Vladimirov
Telerik
Tags
ComboBox
Asked by
Christopher
Top achievements
Rank 1
Answers by
Rosen Vladimirov
Telerik team
Chai Avisar
Top achievements
Rank 1
Share this question
or