views:

19

answers:

1

Is it possible to programatically set the values of a silverlight list box when the selection mode is "multiple"? The "SelectedItems" property is not settable, and "SelectedIndex" only works when the selection mode is "single".

A: 

Add items to SelectedItems collection:

myListBox.SelectedItems.Clear();
foreach(var item in selection)
    myListBox.SelectedItems.Add(item);
STO