Forum Xamarin.Forms

Need Help AutoComplete XLabs(Newbie to Xamarin)

sethimanojsethimanoj USMember ✭✭

Hello Community,

I am a newbie to Xamarin Platform and need help with the AutoComplete Control from XLabs. Can somebody share a small demo app build showing working of AutoComplete.

Till now I have gone through the XLab xaml sample for AutoCompleteView but it's codebehind part is missing. Please help me with that.


Best Answers


  • sethimanojsethimanoj USMember ✭✭

    @AlessandroCaliaro : I had tried that project. I am getting error

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    I don't know, try to open an Issue on GitHub

  • sethimanojsethimanoj USMember ✭✭

    @AlessandroCaliaro : I want something like this
    Can you please direct me how to achieve this on both platforms(iOS and Android) using Xamarin.Forms?

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭
    Accepted Answer

    I have tested XLabs Controls and it works almost like your example. There is the source code so you can modify it.

  • PubuduGayanPubuduGayan NZMember ✭✭✭
    edited July 2016

    Hi @sethimanoj I have implement similar thing but it is a really primary solution. Basically you need Two way text field and list view.

    I ended up like as picture showing . Again I am warning this is not perfect and need lots of implementation for example orientation vice, the section after the list view etc. if you interest please let me know.

  • sarveshsinghsarveshsingh INMember ✭✭

    @AlessandroCaliaro @PubuduGayan @sethimanoj is it possible to implement Autocomplete text box without XLab or any paid nuget plugin in xamarin forms

  • PubuduGayanPubuduGayan NZMember ✭✭✭

    hi @sarveshsingh its long long time a go... anyway if my memory is correct i didn't use any zlab or paid nugets just simple controllers and bit of hack code.

  • sarveshsinghsarveshsingh INMember ✭✭

    thanks @PubuduGayan for reply

  • LyndonHugheyLyndonHughey USUniversity ✭✭✭

    If you're looking for a lightweight solution that doesn't require multiple nuget or installing a larger package, check out
    Install-Package Xamarin.CustomControls.AutoCompleteView -Version 1.0.14

    The code for it is as expected:

    <customControls1:AutoCompleteView ItemsSource="{Binding EmployeeColl}" SearchMember="UniqueID" SuggestionPlacement="Bottom" MaxResults="20" TextColor="{StaticResource LabelValueTextColor}"> <customControls1:AutoCompleteView.ItemTemplate> <DataTemplate> <StackLayout Orientation="Horizontal"> <Label Text="{Binding FullName}"/> </StackLayout> </DataTemplate> </customControls1:AutoCompleteView.ItemTemplate> </customControls1:AutoCompleteView>

    I created a property in my sample EmployeeCollection called UniqueID, which is a delimited value of the person's firstname, lastname, and employeeID. Adding the employeeID to the property was important so the control wouldn't have issues with people having the same first and last name.

    Of course, Syncfusion's controls are a great solution if you plan on using more of their controls. Otherwise, it might not be worth the weight.

  • dotMortendotMorten USMember ✭✭

    I created a Forms one as well, since I didn't rally like how XLabs' control was pushing the entire UI down instead of overlaying the dropdown on top of the UI. You can get the source code (and link to NuGet) here:

    Hopefully you'll find it useful. It's using native controls under the covers, and matches the behavior of the UWP AutoSuggestBox control closely (which means you'll have to filter and update the ItemSource yourself on TextChanged, but I found that gives the most flexibility for a various set of scenarios):

Sign In or Register to comment.