AutoComplete Control Filters List Items It Shouldn't Be

1 Answer 11 Views
AutoComplete
billy
Top achievements
Rank 2
Iron
Iron
Iron
billy asked on 22 Apr 2025, 09:05 PM

I have the below implementation where when a user is typing in the AutoComplete control it calls API to fetch results using keyed text. But noticed that its filtering out results that our web portal (also using Blazor AutoComplete TK) is showing. I want to show all results in the list that is fetched as the user types, but it's not showing them all.

Why?

The ItemsSource is Bound to a collection that contains all results, but it's filtering some out for some reason.


<fv:AutoComplete
			x:Name="specialtyAutoComplete"
			CompletionMode="Contains"
			CornerRadius="0,0,3,3"
			FontSize="12"
			ItemsSource="{Binding SpecialtyAutocompleteList}"
			Margin="0,10,0,0"
			Padding="0,0,30,0"
			Placeholder="Search for Specialty"
			SuggestionViewBackgroundColor="#FFF"
			SuggestionViewBorderThickness=".5"
			TextSearchPath="Synonyms">
			<fv:AutoComplete.Behaviors>
				<tk:RadEventToCommandBehavior Command="{Binding SpecialtyTextChangedCommand}" EventName="TextChanged" />
				<tk:RadEventToCommandBehavior Command="{Binding SpecialtyItemSelectedCommand}" EventName="SuggestionItemSelected" />
			</fv:AutoComplete.Behaviors>
			<fv:AutoComplete.SuggestionItemTemplate>
				<DataTemplate>
					<Grid
						ColumnDefinitions="Auto, *"
						Margin="8,0"
						RowDefinitions="Auto,Auto">
						<Image
							HeightRequest="15"
							Margin="7"
							Source="med_bag"
							VerticalOptions="Center"
							WidthRequest="15" />
						<Label
							FontSize="{OnPlatform Android=12, iOS=10}"
							Grid.Column="1"
							Text="{Binding Code}"
							TextColor="Black"
							VerticalOptions="Center"
							VerticalTextAlignment="Center" />
						<Label
							FontAttributes="Italic"
							FontSize="{OnPlatform Android=11, iOS=9}"
							Grid.Column="1"
							Grid.Row="1"
							Text="{Binding Synonyms}"
							TextColor="#AAA"
							VerticalOptions="Center"
							VerticalTextAlignment="Center" />
					</Grid>
				</DataTemplate>
			</fv:AutoComplete.SuggestionItemTemplate>
			<tk:RadAutoComplete.DisplayTextFormatter>
				<local:SpecialtyTextFormatter />
			</tk:RadAutoComplete.DisplayTextFormatter>
</fv:AutoComplete>

1 Answer, 1 is accepted

Sort by
0
Didi
Telerik team
answered on 23 Apr 2025, 02:29 PM

Hi Billy,

Thank you for the provided details. I am not sure I understood what is the exact issue however I will try to explain how Telerik MAUI AutoComplete control works.

When you bind the collection to the control ItemsSource and start typing, the control filters the collection based on the entered text and displays the items in a suggestionview that matches the filtered criteria -> https://docs.telerik.com/devtools/maui/controls/autocomplete/filtering 
If you want to display all items initially from the collection bound to the AutoComplete.ItemsSource when focusing the control use the ShowSuggestions() method: https://docs.telerik.com/devtools/maui/controls/autocomplete/methods 

If this is not the case, please send a sample app in which the behavior occurs also a video representing the issue. I do not need the original data, you can use sample data. 

Regards,
Didi
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

billy
Top achievements
Rank 2
Iron
Iron
Iron
commented on 29 Apr 2025, 04:31 PM

Thanks Didi,

Took a different approach. I created a new backing property "SearchProperty" (stitching together Code + Synonyms) on the model and pointed the TextSearchPath property to that. It now brings back all the results and displays using the SuggestionTemplate.

Thx

Tags
AutoComplete
Asked by
billy
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Didi
Telerik team
Share this question
or