AutoComplete -- CompletionMode="Contains" not working

7 posts, 0 answers
  1. Sheldon
    Sheldon avatar
    1 posts
    Member since:
    Aug 2017

    Posted 06 Nov 2017 Link to this post

    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?

  2. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    640 posts

    Posted 08 Nov 2017 Link to this post

    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
  3. sandeep
    sandeep avatar
    3 posts
    Member since:
    Nov 2017

    Posted 18 Dec 2017 in reply to Stefan Nenchev Link to this post

    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

  4. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    640 posts

    Posted 19 Dec 2017 Link to this post

    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
  5. Thomas
    Thomas avatar
    2 posts
    Member since:
    Jan 2018

    Posted 09 Apr Link to this post

    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.

  6. Thomas
    Thomas avatar
    2 posts
    Member since:
    Jan 2018

    Posted 09 Apr in reply to Thomas Link to this post

    I also tried to use an ObservableCollection, no effect.
  7. Yana
    Admin
    Yana avatar
    4695 posts

    Posted 10 Apr Link to this post

    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
Back to Top