0

How to setup initial selections in a MVVM listbox that uses checkmark and multiple

asked 2013-07-16 11:26:30 +0800

davout gravatar image davout
1435 3 18

I have a listbox in a MVVM form that uses the checkmark and multiple attributes, like:

<listbox model="@load(vm.children) @save(vm.children,before='save')" checkmark="true" multiple="true" selectedItems="@bind(vm.selectedChildren)" width="150px">

I cant' work out how to set the initial 'checked state of the items in the list box.

Any suggestions?

I've tried using model.addToSelection and it doesn't work.

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-07-16 11:32:11 +0800

davout gravatar image davout
1435 3 18

Solved it. You have to try a 'Set<>' of selected items and set into the 'selectedChildren' property.

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2013-07-16 11:26:30 +0800

Seen: 13 times

Last updated: Jul 16 '13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More