Binding the selected values to the viewmodel with SelectionMode is Multiple

Hi Syncfusion,

The setter for the SelectedItems property on the SfComboBox seems to be "internal".

This prevents me from having a binding to my viewmodel. Is this intended?

I need a binding to me viewmodel, since a button in my view should reset both the possible values (ItemsSource) and the SelectedItems in my dropdowns to the last saved state. I thus need to be able to change the SelectedItems from my ViewModel.


1 Reply

SN Sudharsan Narayanan Syncfusion Team January 15, 2025 01:59 PM UTC

Hi Philip,

In SfComboBox, we do not have support to assign the collection to the SelectedItems property since it is only get accessor as like WinUI MS ListView control.
It is only possible to add, remove and clear the value in SelectedItems property. Please find the below sample and UG link regarding how to update the SelectedItems in code behind.


Sample: Attached below

UG: Selection in WinUI ComboBox control | Syncfusion


If we misunderstood your requirement, please provide more details about your requirement. It would be more helpful to proceed further.

Regards,

Sudharsan


Attachment: ComboBox_SelectedItems_9604d816.zip

Loader.
Up arrow icon