Cannot search a child object in collection


I am having a problem with sfautocomplete under Xamarin Forms UWP. In my case the suggestions disappear after I type the second character in my string

Please look at the following screens when I search for a license plate




I get a suggestion for the first letter 'a' but not after I type a second letter 's' ..there are 2 records that should still appear as a suggestion

Is this a bug? My bindings seem to work..

My DataSource contains a collection of VehicleRecords..  Each VehicleRecord contains an Object Vehicle.  


public class VehicleRecord
{
     public Vehicle Vehicle { get; set; }
}

public class Vehicle
{
 public string LicensePlate { get { return _LicenseNumber; } set { _LicenseNumber = value; NotifyPropertyChanged(); } }
}

AssignedVehicleRecordsDataSource is a collection of VehicleRecord

Here is the  xaml code

<autocomplete:SfAutoComplete x:Name="autoComplete" IsVisible="{Binding IsVehicleListVisible}" 
                                                                                         MaximumDropDownHeight="150" WidthRequest="300"
                                                                                         AutoCompleteMode="Suggest"
                                                                                         DisplayMemberPath="Vehicle.LicensePlate"
                                                                                         DataSource="{Binding AssignedVehicleRecordsDataSource}"
                                                                                         Text="{Binding SelectedItem,Mode=TwoWay}"
                                                                                         SuggestionMode="Contains"
                                                                                         IsFocused="{Binding IsFocused,Mode=TwoWay}"
                                                                                         Watermark="Search Here"
                                     
                                                                                         DropDownItemHeight="100" DropDownCornerRadius="0" 
                                                                                         DropDownHeaderViewHeight="50" DropDownFooterViewHeight="50"
                                                                                         NoResultsFoundText="No Results Found" HeightRequest="45">
                                                                <autocomplete:SfAutoComplete.ItemTemplate>
                                                                    <DataTemplate>
                                                                        <StackLayout WidthRequest="300" Orientation="Horizontal">
                                                                            <Image Margin="7" HeightRequest="45" WidthRequest="45" VerticalOptions="CenterAndExpand"
                                                                                   Source="{Binding Vehicle.BodyType, Converter={StaticResource BodyTypeToImageConverter}}"  />
                                                                            <StackLayout Margin="4" Orientation="Vertical">
                                                                                <Label Text="{Binding Vehicle.LicensePlate}" TextColor="Black" FontSize="15" VerticalOptions="Center"/>
                                                                                <Label Text="{Binding Vehicle.VIN}" FontSize="14" VerticalOptions="Center"/>
                                                                            </StackLayout>
                                                                        </StackLayout>
                                                                    </DataTemplate>
                                                                </autocomplete:SfAutoComplete.ItemTemplate>
                                                                
                                                                <autocomplete:SfAutoComplete.DropDownHeaderView>
                                                                    <StackLayout  BackgroundColor="#FFFAFAFA" Orientation="Horizontal">
                                                                        <Label Margin="15,0,0,0" TextColor="Black" VerticalTextAlignment="Center" HorizontalTextAlignment="Center" FontSize="20">
                                                                            <Label.Text>
                                                                                <OnPlatform x:TypeArguments="x:String" iOS="A" Android="A" WinPhone="&#xe11a;"  />
                                                                            </Label.Text>
                                                                            <Label.FontFamily>
                                                                                <OnPlatform x:TypeArguments="x:String" iOS="icon" Android="icon.ttf#icon" WinPhone="Segoe MDL2 Assets"  />
                                                                            </Label.FontFamily>
                                                                        </Label>
                                                                        <Label Text="{Binding SelectedItemValue}" BackgroundColor="#FFFAFAFA" HorizontalOptions="Fill" 
                                                                               TextColor="Black" VerticalOptions="Center" FontSize="15"/>
                                                                    </StackLayout>
                                                                </autocomplete:SfAutoComplete.DropDownHeaderView>
                                                            </autocomplete:SfAutoComplete>
                                                        </StackLayout>
                                                        

1 Reply

RS Ruba Shanmugam Syncfusion Team February 10, 2021 07:01 AM UTC

Hi Jack,

Greeting from Syncfusion.

We have checked the reported issue "Suggestion hide after typying the second letter" with the latest version and prepared a sample based on the provided code snippet. We regret to let you know that we are not able to replicate the reported issue. Please find the sample and screenshot.

Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/AutoComplete_Suggestion-893753944

Screenshot: 
  
 
  

 
  
Could you please share the following details which would be helpful for us to check on it and provide you solution at the earliest.

Xamarin forms & SfAutoComplete version used in your application
Issue replicating sample (if possible)

Since we were not aware of your exact scenario. Could you please try our sample and let us know if you still facing the same issue? If not, please modify our sample and revert us back with the following details which would be helpful for us to check on it and provide you the solution as soon as possible.

Regards,
Ruba Shanmugam 


Loader.
Up arrow icon