We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

SfAutoComplete > Performance issue with event OnFilterCollectionChanged on IOS

Thread ID:

Created:

Updated:

Platform:

Replies:

148943 Nov 8,2019 10:19 AM UTC Nov 11,2019 10:44 AM UTC Xamarin.Forms 1
loading
Tags: SfAutoComplete
Johannes Meyer
Asked On November 8, 2019 10:19 AM UTC

Hello , 

Im Using Autocomplete Control to filter my entrys of my listview.

The Performance issue is on IOS 11.2+ , Simulator and device.
If entering Letters in the autocomplete box to Filter my Listview (items) with the event OnFilterCollectionChanged the entered letters are not showing or stucking.

Is the using of the event correct for this situation? or use better a more performant event ?
is there a other solution to filter a list of the filtered elements in autocomplete ?

My list Items contains in the test situation only 2 contacts.

Viewmodel:

'
public ObservableCollection<Kontakt> Items { get; set; }

private void SfAutoComplete_OnFilterCollectionChanged(object sender, FilterCollectionChangedEventArgs e)
        {
            var list = (IEnumerable<object>) e.Value;
            var list2 = list.Cast<Kontakt>().ToList();

            if (list2.Count != 0)
                _viewModel.Items = new ObservableCollection<Kontakt>(list2);
            else
                _viewModel.LoadItemsCommand.Execute(null);
        }
'

xaml:
'
<SfAutoComplete TextColor="{StaticResource NavigationPrimary}"
                                    IndicatorTextColor="{StaticResource NavigationPrimary}"
                                    NoResultsFoundTextColor="LightGray"
                                    HighlightedTextColor="{StaticResource NavigationPrimary}"
                                    WatermarkColor="LightGray"
                                    ClearButtonColor="DarkGray"
                                    DropDownTextColor="DarkGray"
                                    SuggestionMode="Contains"
                                    MaximumSuggestion="3"
                                    Watermark="Suchen"
                                    NoResultsFoundText="Kein Kontakt gefunden"
                                    LoadMoreText="Mehr anzeigen"
                                    TextHighlightMode="FirstOccurrence"
                                    DisplayMemberPath="Name" 
                                    DataSource="{Binding Items}"
                                    HeightRequest="40"
                                    SuggestionBoxPlacement="None"
                                    FilterCollectionChanged="SfAutoComplete_OnFilterCollectionChanged"/>
'




Hemalatha Marikumar [Syncfusion]
Replied On November 11, 2019 10:44 AM UTC

Hi Johannes,

Greetings from Syncfusion.
 
 
We have prepared the sample by loading the SfAutoComplete’s FilteredItems as collection of ListView and that has been loaded fine with better performance. Please have the sample from the below link,

Sample Linkhttps://www.syncfusion.com/downloads/support/directtrac/general/ze/AutoComplete_148943-343888824
 
 
Code Snippet[XAML]: 
 <autoComplete:SfAutoComplete  
                                                       x:Name="autoComplete"  
                                                        ……… 
                                                       FilteredItems="{Binding FilteredCollection, Mode=TwoWay}"
                                                       DataSource="{Binding EmployeeCollection}" />

 
        <ListView Grid.Row="1" x:Name="listView"  
                                                ItemsSource="{Binding FilteredCollection}"> 
            <ListView.ItemTemplate> 
                <DataTemplate> 
                    <ViewCell> 
                        <Label Text="{Binding}"  
                                    VerticalOptions="Center"  
                                    Margin="10,0,0,0"  
                                    FontSize="15"  
                                    FontAttributes="Bold" /> 
                    </ViewCell> 
                </DataTemplate> 
            </ListView.ItemTemplate> 
       </ListView> 


 
Since we are not aware of your exact application scenario, therefore, we ask you to try our sample and may you kindly revert to us by changing the sample depending on your request along with the replication steps. 

 
Regards, 
Hemalatha M. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon