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.
Unfortunately, activation email could not send to your email. Please try again.

AutoSuggest not working

Thread ID:

Created:

Updated:

Platform:

Replies:

128303 Jan 12,2017 05:28 PM Jan 15,2017 11:03 PM WPF 4
loading
Tags: SfTextBoxExt
Andy Johnson
Asked On January 12, 2017 05:28 PM

Hi,
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.

Thanks

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

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.   
    
Regards,  
Mariappan   


Andy Johnson
Replied On January 13, 2017 09:29 AM

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 13, 2017 08:02 PM

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 15, 2017 11:03 PM

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


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.

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.

;