AutoCompleteBox - Backspace issue

0 Answers 5 Views
AutoCompleteBox
James
Top achievements
Rank 1
James asked on 27 May 2025, 11:09 AM | edited on 27 May 2025, 11:29 AM

I currently have an RadAutoCompelteBox similar to this:

        <telerik:RadAutoCompleteBox  x:Name="MyGrid"
                                 KeyDown="OnSearchBoxKeyDown"
                                 SearchTextChanged="OnSearchTextChanged"
                                 ItemsSource="{Binding Source={StaticResource ViewModel}}, Path=Data.MyData"
                                 SelectionMode="Single"
                                 DisplayMemberPath="Display"
                                 TextSearchPath="MyNumber"
                                 SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
                                 SearchText="{Binding SearchText, Mode=TwoWay}"
                                 TextSearchMode="Contains"
                                 DropDownItemTemplate="{StaticResource MyDropDownTemplate}">
            <telerik:RadAutoComplete.FilteringBehavior>
                <telerik:AsyncFilteringBehavior/>
            </telerik:RadAutoComplete.FilteringBehavior>
        </telerik:RadAutoCompleteBox>

What is happening is this.
View the view loads we load the selected item has it has a value. (Say "123456").

When the user clicks on the autocompeltebox the whole selection highlights. (That's fine)
User then clicks it a second time and the cursor is then at the end of the 6 in my example.
User then clicks backspace and the entire selection clears out. 

At that point why would it not just remove the 6?


        private void OnSearchTextChanged(object sender, EventArgs e)
        {
            // Try to capture this and do what I want.
        }

I've tried to use this method to achieve what I want to happen, however the EventArgs is always empty.

How can I accomplish this? (I want the backspace to clear one character at a time)

I will note that we have other AutoCompleteBoxes that work as intended the only difference between those ones and this one is that the ones that work have all the data loaded up front in the ItemsSource.
This one we are searching the DB for the data as the user types.

Dimitar
Telerik team
commented on 28 May 2025, 06:01 AM

Hi James, 

This seems to be a complex scenario. This is why I want to ask to create a small sample project that reproduces this (some sample data). This way we will be able to properly invesigate the case and determine why this is not working as expected.

Thank you in advance for your patience and cooperation. 

No answers yet. Maybe you can help?

Tags
AutoCompleteBox
Asked by
James
Top achievements
Rank 1
Share this question
or