views:

201

answers:

3

I have a listbox that has its SelectionMode property set to Multiple.

Is it possible to bind the SelectedItem property to a List? and not to a single item?

Thanks

+1  A: 

You can use ListBox.SelectedItems property for this.

    <ListBox x:Name="listBox" SelectionMode="Multiple" ItemsSource="{Binding YourCollection}" />
    <ListBox ItemsSource="{Binding SelectedItems , ElementName=listBox}"/>
Jobi Joy
+1  A: 

I've been using Samuel's solution for this and it works very well.

http://blog.functionalfun.net/2009/02/how-to-databind-to-selecteditems.html

Scott Bilas
A: 

I'm using this solution and it works great: http://alexshed.spaces.live.com/blog/cns!71C72270309CE838!149.entry

RyanHennig