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. Image for the cookie policy date

After changing autoComplete DataSource It still suggests for history items.

Hi,
I am using autoComplete over a textbox which suggests items after we start typing over it. The suggestion list or the datasource assigned to the autocomplete needs to change its values after the index changed of a comboBox.
Ex- I have a comboBox of Country and textBox of State . After I change the Country the suggestion for state should change. However , it works quite well till the new list have anything to suggest. If it the suggestion list doesn't have anything to suggest then it goes and pick from the old list.
   Like - I select Country as INDIA and start typing over the State textbox. 
   For B - Its giving me suggestion as Bombay... 
   For Bi - Expected result is It should not suggest anything as I don't have any state list which starts or contains "Bi" . 
   But unfortunatly it suggest me Birmingham which was in earlier suggestion list for Country England.

Tried with assigning Nothing to datasource and ResetHistory of autocomple but still no luck. Please suggest some way around to achieve this.
Thanks in advance.

Regards,
Priyadarshi

3 Replies

PB Priyanga Balasubramaniam Syncfusion Team June 7, 2017 11:08 AM UTC

Hi Priyadarshi,

Thank you for using Syncfusion products.

AutoCompleteCustomSource of TextBox holds the old values. So, it displays the old values in suggestion. We have prepared the simple sample to meet your requirement. In this sample, in SelectedIndexChanged event of ComboBox cleared the AutoCompleteCustomSource of TextBox before assigning the new collection.

Please download the sample from the below location.

Sample:F130385

Regards,
Priyanga B



PR Priyadarshi June 9, 2017 07:19 AM UTC

Hi Priyanga,
Thanks for quick response. It worked for me.

Thanks,
Priyadarshi




KJ Keerthana Jegannathan Syncfusion Team June 12, 2017 03:50 AM UTC

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


Loader.
Live Chat Icon For mobile
Up arrow icon