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

RadComboBox - Incorrect Autocomplete filtering when using VirtualizingStackPanel

1 Answer 169 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Karl Farrand
Top achievements
Rank 1
Karl Farrand asked on 29 Mar 2013, 09:41 PM
Hi,

I am using a RadComboBox to select an item from a long, dynamic list (potentially several thousand).
NB: The RadComboBox is being used inside a RadGridView, using GridViewDataColumn.CellEditTemplate

For performance I have had to use the ComboBox Virtualiztion as described here
However when I use Virtulization the AutoComplete filtering gives me a incorrect list. As per the screenshots below.

Without Virtulization I get the correct filtering as shown in the attached image radcomboboxworks.png
When I type in 'John' only the four correct results show in the dropdown.
The code for this is here:

<telerik:RadComboBox 
    IsFilteringEnabled="True"
    TextSearchMode="Contains"
    CanAutocompleteSelectItems="True" 
    CanKeyboardNavigationSelectItems="True"
    IsEditable="True"
    OpenDropDownOnFocus="True"
    DisplayMemberPath="FullNameAndEmployeeId"
    SelectedItem="{Binding Employee, Mode=TwoWay}"
        telerik:TextSearch.TextPath="FullNameAndEmployeeId"
    ItemsSource="{Binding EmployeeList, Source={StaticResource EmployeeDataList}}">
</telerik:RadComboBox>


When I add virtualisation I get some expected items followed by a number of  additional items. To make it more odd these extra items seem to be random and will change if I retype 'John'
The code for this is here:

<telerik:RadComboBox 
     IsFilteringEnabled="True"
     TextSearchMode="Contains"
     CanAutocompleteSelectItems="True" 
     CanKeyboardNavigationSelectItems="True"
     IsEditable="True"
     OpenDropDownOnFocus="True"
     DisplayMemberPath="FullNameAndEmployeeId"
     SelectedItem="{Binding Employee, Mode=TwoWay}"
        telerik:TextSearch.TextPath="FullNameAndEmployeeId"
     ItemsSource="{Binding EmployeeList, Source={StaticResource EmployeeDataList}}">
     <telerik:RadComboBox.ItemsPanel>
     <ItemsPanelTemplate>
     <VirtualizingStackPanel />
     </ItemsPanelTemplate>
     </telerik:RadComboBox.ItemsPanel>

</telerik:RadComboBox>


Any ideas on why this filtering behaviour is different and how to make it filter correctly when using virtualization?

Thanks
Karl

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 02 Apr 2013, 08:51 AM
Hello Karl,

I am afraid that you cannot use filtering and virtualization features of RadComboBox at the same time. We are aware of this limitation but since the ComboBox is ItemsControl, this behavior cannot be changed.

However,  I would suggest to check our new RadAutoCompleteBox control, it seems suitable to your scenario. You can find its demos here and documentation here.

All the best,
Yana
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
ComboBox
Asked by
Karl Farrand
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or