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

How to clear previous selection in code behind?


I am using SfAutoComplete control for my project. The behaviour I am after is when an item is selected from the suggestion list, 
1. I want add it to an ObservableCollection in code behind 
2. After it is added to the collection, I want to clear the selection from the view (which is the functionality of the cross icon click on the selection)

I am able to add it, but not able to clear the selection from code after addition. I tried method ClearValue(SfAutoComplete.SelectedValueProperty), but it seems to be doing nothing.
Please help.


7 Replies

VA Vanaja  Annasamy Syncfusion Team August 1, 2017 07:06 PM UTC

Hi Rohan,

Thank you for contacting Syncfusion support.

We were unable to reproduce the reported issue "Unable to clear the previous items which is selected from the suggestion list". We have created the sample for your reference. Please download the same from the below link.

Link:  http://www.syncfusion.com/downloads/support/directtrac/184440/ze/AutoComplete128205-115303554 

Please run the sample and check whether issue reproduces at your end. If not please modify your changes in the above sample and revert the issue reproducing sample with replication steps. Please mention the platform in which you could reproduce the issue and this will help us to replicate the issue at our end.

Vanaja R.A, 

RS Rohan Satpute August 8, 2017 06:26 AM UTC


 Your project just shows a normal working sfautocomplete and clearing from UI (clicking the cross button). What I wanted to achieve is to use a method in code behind to clear the selected value on occurrence of an external event. I tried ClearValue method, but it doesn't work. 



SK Selva Kumar  Veerakrishnan Syncfusion Team August 9, 2017 02:02 PM UTC

Hi Rohan,

We have considered the issue "ClearValue method does not clear the SelectedValue" as bug and the support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates.

Selva Kumar V.

DM Darren McDaniel August 14, 2017 11:06 PM UTC

I'm experiencing the exact same issue with the latest binaries.... I used to be able to clear the text value  .Text = string.Empty;

but now.. nothing seems to be able to clear the value except the 'X' on the screen... 

CP Chozarajan Pandiyarajan Syncfusion Team August 15, 2017 12:59 PM UTC

Hi Rohan,

The reported issue "The SelectedValue has not cleared if we set the String.Empty to Text API" has already fixed in SfAutoComplete and we have provided the custom assemblies to you in your account. Please log on to our support website to check for further updates.

Chozarajan P 

AF Allen Foster February 27, 2018 09:43 PM UTC

I am experiencing the same problem with version

RB Rabhia Beham Kathar Mideenar Syncfusion Team February 28, 2018 04:27 PM UTC

Hi Rohan,

We are not able to reproduce the reported issue in SfAutoComplete Control with the latest Syncfusion Assemblies(16.1451.0.24). We have prepared a sample with your requirement.Please find the sample from the below link.

Sample Link: http://www.syncfusion.com/downloads/support/forum/131849/ze/AutoComplete128205_217417411

Please Check the sample provided and if the issue still persists from your side.Please modify the same with the issue reproducing steps which will be helpful for us to analyse further and update the appropriate solution.

Please let us know if you have any concern.

Rabhia Beham K.

Live Chat Icon For mobile
Up arrow icon