WPF RadComboBox Disable auto select first item on databinding

0 Answers 84 Views
ComboBox
Praveenraj
Top achievements
Rank 1
Praveenraj asked on 21 Feb 2024, 10:37 AM | edited on 24 Feb 2024, 10:32 AM

We have a issue with WPF RadComboBox to disable the auto selection of first item while databinding.

I have large set of data (say 10000 items) in the application cache.

<telerik:RadComboBox
                                        x:Name="itemBox"
                                        HorizontalAlignment="Stretch"
                                        telerik:TextSearch.TextPath="Name"
                                        CanAutocompleteSelectItems="False"
                                        DisplayMemberPath="Name"
                                        EmptyText="Select item"
                                        IsEditable="True"
                                        IsFilteringEnabled="True"
                                        IsReadOnly="False"
                                        IsTextSearchEnabled="True"
                                        ItemsSource="{Binding ItemCollection, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                        OpenDropDownOnFocus="True"
                                        ScrollViewer.VerticalScrollBarVisibility="Auto"
                                        SelectedItem="{Binding SelectedItem, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                        TextSearchMode="Contains">

                                                <telerik:EventBinding
                                                Command="{Binding BeginSearchCommand}"
                                                EventName="KeyUp"
                                                PassEventArgsToCommand="True" />
</telerik:RadComboBox>

We have the RadCombobox with Filter enabled.

BeginSearchCommand relay command method has implementation of filtering the cached ItemCollection and setting the value.


this.ItemCollection = new QueryableCollectionView(new ObservableCollection<ItemModel>(filtereditems));

I first load 50 items in RadCombobox and the user will try to search the items from SearchText . Then the items in the cache is filtered with searchtext and the result is assigned with the datasource property.

  1. User start searching
  2. The first item from the filtered result occupies the search text.

The couple of action above continues. Please help us disable autoselect  while databinding.

Dimitar
Telerik team
commented on 23 Feb 2024, 08:42 AM

Hi Praveenraj, 

I have tried to reproduce this but in my project the item is not selected. I have attached my test project. Could you please update it so it reproduces the exact case? 

I am looking forward to your reply.

No answers yet. Maybe you can help?

Tags
ComboBox
Asked by
Praveenraj
Top achievements
Rank 1
Share this question
or