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.

Set selected items from list or object from ViewModel

Thread ID:

Created:

Updated:

Platform:

Replies:

121166 Nov 16,2015 09:24 AM Nov 19,2015 04:46 AM WPF 3
loading
Tags: ComboBoxAdv
Peter Viau
Asked On November 16, 2015 09:24 AM

I'm looking at the sample application in"Syncfusion\EssentialStudio\13.3.0.7\WPF\Tools.WPF\Samples\ComboBox\ComboBox\CS".

How do I set the selected items in ViewModel  to UK an CA on startup for example?

I will be loading the selected items from a database in the future so I need to understand how to load and save selected items.



Sugapriya Mariappan [Syncfusion]
Replied On November 17, 2015 06:37 AM

Hi Peter,

Thank you for contacting Syncfusion Support

“Query #1: How do I set the selected items in ViewModel to UK and CA on startup for example?”

We have prepared a sample which tries to meet your requirement .In this sample, we have bound the first two items from the ObservableCollection to the SelectedItems collections property.

Please download the sample from the below link
Sample link:ComboBoxadvSample

“Query #2: how to load and save selected items.

We have bound the Checked ListBox SelectedItems to the ComboBoxAdv’s SelectedItems collection property in the button click event via command binding to achieve your requirement.

Please find the sample attached in the following link.
Sample: ComboboxAdvSaveSample

Regards,
M.Sugapriya

Peter Viau
Replied On November 18, 2015 09:45 AM

Thank you for your quick reply!
I was able to combine both your samples to get what I needed except for one little enhancement I'd like to have.

Is it possible to add a checkbox called "All Users" that acts like  a toggle so that if "All Users" is checked all  the others get checked, and if "All Users" is unchecked then all get unchecked?
I think it would also get unchecked if the user selects another entry while it is checked.

Sugapriya Mariappan [Syncfusion]
Replied On November 19, 2015 04:46 AM

Hi Peter,

We would like to inform you that we don’t have this support “Select and unselect all the items in ComboBoxAdv” currently and so have logged feature report regarding this. A support incident to track the status of this feature has been created under your account. Please log on to our support website to check for further updates

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents

Please let us know if you have any questions.

Regards,
M.Sugapriya

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.

;