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

AutoComplete -- CompletionMode="Contains" not working

6 Answers 129 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
Sheldon
Top achievements
Rank 1
Sheldon asked on 07 Nov 2017, 03:49 AM

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

Sort by
0
Stefan Nenchev
Telerik team
answered on 08 Nov 2017, 02:58 PM
Hi, Sheldon,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
sandeep
Top achievements
Rank 1
answered on 18 Dec 2017, 01:22 PM

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

0
Stefan Nenchev
Telerik team
answered on 19 Dec 2017, 11:53 AM
Hi, 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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Thomas
Top achievements
Rank 1
answered on 09 Apr 2018, 08:51 PM

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.

0
Thomas
Top achievements
Rank 1
answered on 09 Apr 2018, 08:55 PM
I also tried to use an ObservableCollection, no effect.
0
Yana
Telerik team
answered on 10 Apr 2018, 11:40 AM
Hello 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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
AutoComplete
Asked by
Sheldon
Top achievements
Rank 1
Answers by
Stefan Nenchev
Telerik team
sandeep
Top achievements
Rank 1
Thomas
Top achievements
Rank 1
Yana
Telerik team
Share this question
or