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.

Clear selection once selected

Thread ID:

Created:

Updated:

Platform:

Replies:

130212 Apr 27,2017 05:36 PM May 12,2017 02:42 AM WPF 7
loading
Tags: ComboBoxAdv
Andy Johnson
Asked On April 27, 2017 05:36 PM

Hi,
I would like to know if there is an easy way to clear the selection once it is selected (I am using it as a Dropdown.. i.e. single selection only) and my ComboBox is bound to a list of collection..

This is my Xaml

<syncfusion:ComboBoxAdv x:Name="FirstInvestor" Margin="10,0,0,10"
                                                               Grid.Column="1" Grid.Row="0"
                                                               ItemsSource="{Binding Investors, Mode=TwoWay, NotifyOnValidationError=True, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}"
                                                               Validation.Error="Validation_Error"
                                                               SelectedItem="{Binding Investment.FirstInvestor, Mode=TwoWay, NotifyOnValidationError=True, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}"
                                                               DisplayMemberPath="FullName" MaxWidth="400" 
                                                               SelectionChanged="FirstInvestor_OnSelectionChanged"
                                                               />

Vinothini [Syncfusion]
Replied On April 28, 2017 08:16 AM

Hi Andy, 
 
Thank you for using Syncfusion products. 
 
We have used the given code snippet with the list collection in our sample, but we were not clear about your requirement. Can you brief about your requirement of clearing the selection of SelectedItems and the property bound to SelectedItem?  
 
Please provide us the information, so that we can work on it to provide you a solution. 
 
Regards, 
Vinothini 


Andy Johnson
Replied On May 1, 2017 10:19 AM

Ok,I have created a solution to re-create the issue I have.. Please run the project and you will see two choices "Andy" and "Johnson". Once you select any of the choices, there is no way for us to clear the selection in case of non-required fields if I decide to not fill-in that field.ThanksAndyAttachment: ComboBoxAdv_9aea0a77.zip

Vinothini [Syncfusion]
Replied On May 2, 2017 07:13 AM

Hi Andy, 
 
Thank you for your update. 
 
We can clear the SelectedItem as per your requirement by setting the SelectedItem binding property to null. We have prepared sample for this and it is available below. 
 

Please let us know whether this solution works. 
 
Regards, 
Vinothini.R 


Andy Johnson
Replied On May 9, 2017 02:22 PM

Vinothini,
I run the sample code you provided and figured that is only the solution to provide a clear button to clear the selection..
But if you run your code and do the following steps:

  1. Select any name from the list
  2. Clear name using a button
  3. Try to select the name again.

Here there seems to be a bug where newly selected item is not being displayed. Can you please help me with this?

Thanks


Vinothini [Syncfusion]
Replied On May 10, 2017 05:43 AM

Hi Andy, 
 
We have checked the provided sample with the given steps and we could find that items can be cleared and selected again. In this case, the selected item is displayed. Could you please check with the below video and let us know whether we have missed any steps, 
 
 
Regards, 
Vinothini.R 


Andy Johnson
Replied On May 11, 2017 09:58 AM

Please look at the video from my end. Same code.


Attachment: 20170511_85512_39483216.zip

Keerthana Jegannathan [Syncfusion]
Replied On May 12, 2017 02:42 AM

Hi Andy, 
 
We considered this defect “SelectedItem has not been updated properly in ComboBoxAdv” as bug and a 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. 
 
 
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.

;