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

Auto Complete Always Shwoing No Results

1 Answer 22 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 02 Nov 2020, 04:15 PM

I have an Autocomplete control that is bound to an ObservableCollection of my view search result view models. However, when I update the collection (clear it and add each result) the control only shows the "No Results Found" message.

I'm not using any code behind for this, I have a Behavior that handles the TextChanged event which calls an ICommand on my view model to update the list of results. I've posted the code for my view below, if you need more context I can provide the Behavior or View Model code as well.

View

<telerikInput:RadAutoCompleteView Grid.Row="0" ItemsSource="{Binding RetailerSearchResults, Mode=TwoWay}">
                <telerikInput:RadAutoCompleteView.Behaviors>
                    <sharedBehaviors:TelerikAutoCompleteTextChangedBehavior Command="{Binding RetailerSearchTextChangedCommand}" Timeout="1000" />
                </telerikInput:RadAutoCompleteView.Behaviors>

                <telerikInput:RadAutoCompleteView.SuggestionItemTemplate>
                    <DataTemplate x:DataType="{x:Type viewModels:RetailerListItemViewModel}">
                        <ViewCell>
                            <Label Text="{Binding DisplayName}"></Label>
                        </ViewCell>
                    </DataTemplate>

                </telerikInput:RadAutoCompleteView.SuggestionItemTemplate>
            </telerikInput:RadAutoCompleteView>

 


1 Answer, 1 is accepted

Sort by
0
Lance | Manager Technical Support
Telerik team
answered on 02 Nov 2020, 08:40 PM

Hi Andrew,

You have a behavior that uses the text changed event to modify the items source? This will interfere with the AutoCompleteView's internal behavior because you're always changing the items. That is the job the the control's internal logic, not your business layer.

If you are looking for a load on demand-like behavior, then please use the AutoCompleteView | Remote Search feature of the control instead of a custom behavior.

Further Assistance

If you still continue to have trouble, please take the following steps so we can assist:

  1. Go to the Your Account - Get Support page
  2. Open a new Support Ticket (select UI for Xamarin > AutoCompleteView)
  3. Zip up the files you are using for that view, the view model and the custom behavior
  4. Attach that ZIP file to your ticket and explain how we can reproduce the problem

With that info, the Xamarin team can directly investigate and provide you with an answer/solution. Good luck!

 

Side Note

I'm not sure why you're using TwoWay binding for the ItemsSource... unless you do want the UI control to update the view model value to null. I recommend using the default OneWay mode.

<telerikInput:RadAutoCompleteView ItemsSource="{Binding RetailerSearchResults}">

Regards,
Lance | Manager Technical Support
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
AutoComplete
Asked by
Andrew
Top achievements
Rank 1
Answers by
Lance | Manager Technical Support
Telerik team
Share this question
or