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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

AutoSuggest not working

Thread ID:





128303 Jan 12,2017 10:28 PM UTC Jan 16,2017 04:03 AM UTC WPF 4
Tags: SfTextBoxExt
Andy Johnson
Asked On January 12, 2017 10:28 PM UTC

I am trying to implement the AutoSuggest but doesn't seem to be working

I have a List<string> with more than 6000 records that I have bound to a control and it doesn't auto suggest

Here is my XAML
<Syncfusion:SfTextBoxExt Grid.Column="1" Grid.Row="8" x:Name="City"  Margin="10,0,0,10" AutoCompleteSource="{Binding Cities}" AutoCompleteMode="Suggest" SuggestionMode="StartsWith" SearchItemPath="" Text="{Binding FamilyMember.City, Mode=TwoWay, NotifyOnValidationError=True, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" Validation.Error="Validation_Error"/>

I can swear that Cities object is available on this user control.

I am also looking for two events for this textbox where user either completes typing on a text box and moves away from this field and also if they select from suggested items. I then want to populate State and Country from that typed or selected value.


Mariappan S [Syncfusion]
Replied On January 13, 2017 09:00 AM UTC

Hi Andy,   
Thank you for contacting Syncfusion Support.  
We have checked your code example. In this code example, you set SearchItemPath as empty so it doesn’t search the given text. We have prepared sample that meets your requirement. In this sample, we have populated Cities collection in the SfTextBoxExt control and shown the “State” and “Country” based on SfTextBoxExt selection.   
Please download the sample from the below location.   
Sample link: SfTextBoxExtSample
If your requirement differs from this sample, please provide more information about your requirement that would help to proceed further.   

Andy Johnson
Replied On January 13, 2017 02:29 PM UTC

Hi Mariappan,
I looked at your solution. But as I mentioned, I am using the List<string> as cities. My cities is not a list<object> where I can define the SearchItemPath. That is why I kept the SearchItemPath empty since I don't have it in List<string>

It really means that, I can not use the simple list to populate AutoSuggest? If not, I can modify my code to get the List<object> and define SearchItemPath in my XAML. That is not a big issue.

Also, I am looking for two triggers
  1. When user selects the suggested option from the listt
  2. When no match from suggestion and user types in the field and focus is lost from that field(onBlur. I am sorry but I am coming from web development background)

Can you please show me those two triggers MVVM way?

Andy Johnson
Replied On January 14, 2017 01:02 AM UTC

Mariappan ,
Finally I made it work. My problem was that I was not using the ObservableCollection in my ViewModel to declare and initialize the List of Cities. And another thing is that, I started using the collection instead of List<string>.
I also managed to use the Event "SelectionChanged" which behaves like KeyUp and seems enough for me.

Thanks for all your help

Keerthana Jegannathan [Syncfusion]
Replied On January 16, 2017 04:03 AM UTC

Hi Andy, 
Thank you for your update. 
Please let us know if you need further assistance on this. 
Keerthana J 


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