Get Selected Tokens

Hi there,

Unless I am missing it, it seems it's not possible to bind to the list of tokens that the user selects in multiselectmode in and SFAutoComplete? This would be very useful for MVVM, otherwise it seems it is necessary to add and remove items to a collection manually. Or as I say perhaps I am just missing it!

Thanks

Will

6 Replies

WI William April 18, 2018 02:35 PM UTC

Actually I haven't been able to find any way to access the items selected. It's possible to intercept each item as it's added through SelectedItem, but if the user removes one I can't find any way of intercepting this.

Could you please inform me how to bind to all of the selected items, or a way of finding out when items are added or removed.

Thanks


RB Rabhia Beham Kathar Mideenar Syncfusion Team April 19, 2018 12:31 PM UTC

Hi William,

Thanks for contacting Syncfusion Support.

We have analysed your requirement and have created a sample using SfAutoComplete Control.In that we have bound the AutoComplete SelectedItem Property. Please have the sample from the below link.

Sample Link: http://www.syncfusion.com/downloads/support/forum/137091/ze/Autocomplete_3-559263011
 

We are currently facing issues in Two way Binding and we are working on the fix. And the fix will be available in upcoming Volume 1 Sp 2 Release.

Please check the sample and let us know if you have any concern.

Regards,
Rabhia Beham K.
 



WI William April 21, 2018 01:05 PM UTC

Hi Rabhia,

Thanks for your reply. I have seen this solution already posted on a previous question, it seems to only work by binding to items in a separate listview, not with the selected items of the autocomplete.

In the mean time I have decided to go with a different solution to my problem.

Many thanks

Will


RB Rabhia Beham Kathar Mideenar Syncfusion Team April 23, 2018 12:00 PM UTC

Hi William,

As updated earlier currently we are currently facing issues in Two way Binding and we are working on the fix and also as we promised earlier fix will be available in upcoming Volume 1 Sp 2 Release.

Please let us know if you have nay concern.

Regards,
Rabhia Beham K.


MA Markus June 18, 2019 03:34 PM UTC

This issue seems still unfixed in Version v17.1.0.52 am I right?

My ViewModel's item property is defined like so:

public ObservableCollection<object> SelectedEmployees { get; set; }

The SfAutoComplete's markup is:

<syncfusion:SfAutoComplete 
   SelectedItem="{Binding SelectedEmployees}"
   DisplayMemberPath="Name" 
   DataSource="{Binding Employees}" 
   MultiSelectMode="Token" 
   TokensWrapMode="Wrap"
   IsSelectedItemsVisibleInDropDown="false"
   EnableSelectionIndicator="true"/>

The model's collection is populated by the control but the control wouldn't display any data contained in the collection when the BindingContext is set.

Do you have any updates on this?

Kind regards
Markus





MK Muneesh Kumar G Syncfusion Team June 19, 2019 09:33 AM UTC

Hi Markus, 
  
We suspect that the fix has not been applied in your application correctly. This problem occurs due the nuget cache has not been cleared correctly in your system. Please follow steps mentioned in below link before applying the patch.  
  
  
If you still face the problem, please modify the below sample based on your application along with replication procedure. This will be helpful for us to investigate further and provide you a better solution at the earliest. 
  
  
Thanks, 
Muneesh Kumar G. 


Loader.
Up arrow icon