For the RadAutoComplete control for Xamarin (release 2017.3.1103.4), I have tried setting the CompletionMode property both in markup and the code-behind, but the typeahead always behaves as though "StarsWith" was the value instead of "Contains."
Is this a bug in the current release?
6 Answers, 1 is accepted
I could not reproduce this behavior in any of the platforms. I have used the GettingStarted example from the SDK Samples Browser(available in the Examples folder of your local Telerik UI for Xamarin installation). Here is the code:
var autoComplete =
new
RadAutoComplete { Watermark =
"Search here..."
};
autoComplete.CompletionMode = Telerik.XamarinForms.Input.AutoComplete.CompletionMode.Contains;
// << autocomplete-getting-started-csharp
autoComplete.ItemsSource =
new
List<
string
>()
{
"Freda Curtis"
,
"Jeffery Francis"
,
"Eva Lawson"
,
"Emmett Santos"
,
"Theresa Bryan"
,
"Jenny Fuller"
,
"Terrell Norris"
,
"Eric Wheeler"
,
"Julius Clayton"
,
"Alfredo Thornton"
,
"Roberto Romero"
,
"Orlando Mathis"
,
"Eduardo Thomas"
,
"Harry Douglas"
};
var panel =
new
StackLayout();
panel.Children.Add(autoComplete);
this
.Content = panel;
The behavior works as expected. Please provide more information on your setup. You can try rebuilding your example after changing the CompletionMode and testing.
Regards,
Stefan Nenchev
Progress Telerik
Hello,
I am facing the same problem. If i am giving static data as in the example it's working fine.
But when I get the data after a Rest call and then assign the data back to the control, then the completionmode is not working.
Please help.
public async void setupUI() {
if (!vm.patientList.Any())
{
DependencyService.Get<IUtil>().showProgressHUD(AppResources.kGCSDownload);
//fetch patients only once, then we can use the in memory model
// if we want to fetch again, we will tap the sync button on the Toolbar
await Task.Run(async () =>
{
await vm.FetchPatientsAsync();
});
DependencyService.Get<IUtil>().hideProgresHUD();
}
searchBox.TextSearchPath = "Name";
searchBox.CompletionMode = Telerik.XamarinForms.Input.AutoComplete.CompletionMode.Contains;
searchBox.ItemsSource = vm.patientList;
}
I can also see that if I put the ItemsSource = vm.patientList before searchBox.TextSearchPath = "Name";
The search will display the model class like this PatientInfo and not the actual PatientInfo.Name, but if i give it after then it's working fine.
Thanks,
Sandeep
Can you please test the behavior with the latest minor release - 2017.3.1214 - as we have applied a fix for the following issue - AutoComplete: [Android]Changing the ItemsSource causes the CompletionMode to always be StartsWith. Furthermore, we have fixed the following issue as well - AutoComplete: ObservableCollection notification changes are not respected. With this in mind, you can try to use an ObservableCollection to store your items and clear/fill it with items when you need to.
I hope the information will be useful and will resolve the issues at your end.
Regards,
Stefan Nenchev
Progress Telerik
Hi,
I am facing the exactly same problem on Xamarin.Forms, but only on iOS. I have the latest Update of Telerik installed: 2018.1.405.2.
The Contains property works fine when deploying to an Android device, but when using iOS its always StartsWith not Contains. The only thing that works on iOS ist when I follow the examples exactly and use static strings as data. But thats not an option for me, because I don't have the data ready, when the AutoComplete is initialized. Later I can change the data source, but the autocompletions stays StartsWith.
Would be great to have a working solution for iOS.
Thanks,
Thomas.
Thank you for reporting this issue with the CompletionMode of AutoComplete on iOS. I've managed to reproduced it and logged it in our Feedback Portal, you could follow the item at the link below:
https://feedback.telerik.com/Project/168/Feedback/Details/245539-autocomplete-ios-contains-completionmode-does-not-work-properly-when-the-ite
I am afraid I couldn't find a suitable work-around that I could suggest.
I am sorry for the caused inconvenience. Please find your points as a small sign of gratitude for your involvement.
Regards,
Yana
Progress Telerik