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

Clearing selected items/ SelectedIndices from SfComboBox Control (MVVM)?

I'm trying to clear the selected items from the SfComboBox controls (used for multi selection) and I tried doing it by clearing the SelectedIndices property from ViewModel like this.

attribute.SelectedIndices?.Clear();

This is how the XAML of the SfComboBox is:

 SelectedIndices="{Binding SelectedIndices, Mode=TwoWay}"

SelectedIndices property updates with all the indices of the selection from the combo box control but clearing it doesn't clear the UI (SfComboBox) only the values get clears. I also tried setting the SelectedIndices propery to null like this 

attribute.SelectedIndices = null;

but it also did not work.

How can I clear these values and update the UI from the ViewModel in MVVM way?


2 Replies

VV Vijayakumar Viswanathan Syncfusion Team February 10, 2023 12:29 PM UTC

Hi Ruvindra,

We are able to reproduce the reported issue “Items were not removed from the UI while clearing the SelectedIndices” confirmed it as a bug and logged a bug report. You can track the status of the bug resolution from the below link.

 

Link: https://www.syncfusion.com/feedback/41042/items-were-not-removed-from-the-ui-while-clearing-the-selectedindices

 

We will provide a patch for this issue on February 24, 2023. We appreciate your patience until then.

 

Note: The provided feedback link is private, and you need to log in to view this feedback.

 

If you have any more specifications/precise replication procedures or a scenario to be tested, you can add them as a comment in the portal.



VV Vijayakumar Viswanathan Syncfusion Team February 24, 2023 11:08 AM UTC

Hi Ruvindra,

Thanks for your patience.

We have fixed the reported issue  "[XForms- UWP] Items were not removed from the UI while clearing the SelectedIndices". Please find the fixed assemblies and NuGet using the below link.  Currently, the patch was generated in the 20.4.0.48 version. 

Assembly version: 20.4.0.48 

Assembly:  https://syncfusion.com/Installs/support/patch/20.4.0.48/1270249/T435179/SyncfusionPatch_20.4.0.48_1270249_2242023050642458_T435179.zip

Nuget:  https://syncfusion.com/Installs/support/patch/20.4.0.48/1270249/T435179/SyncfusionNuget_20.4.0.48_1270249_2242023050642458_T435179.zip

 

Disclaimer:

Please note that we have created this patch for version 20.4.0.48 specifically, to resolve the issue reported in this incident. If you have received other patches for the same version for other products, please apply all patches in the order received.


Note: Please refer to the below link to apply the custom assembly

https://www.syncfusion.com/kb/8279/how-to-apply-the-custom-assemblies-when-configured-the-project-with-syncfusion-nuget

 

Note: Please clear the NuGet cache, before using the latest one.

https://www.syncfusion.com/kb/6987/how-to-clear-nuget-cache


Loader.
Live Chat Icon For mobile
Up arrow icon