Monthly Archives: May 2010

Handling DataGrid.SelectedItems in an MVVM-friendly manner

.NET, Blend, MVVM, Silverlight, Technical stuff, Work, WPF

This post was imported from my old blog and had 31 comments which are included as a screenshot at the end of this post.

An interesting question from one of the MVVM Light users today:

Is there an MVVM-friendly way to get a DataGrid’s SelectedItems into the ViewModel?

The issue there is as old as the DataGrid (that’s not very old but still): SelectedItem (singular) is a DependencyProperty and can be databound to a property in the ViewModel. SelectedItems (plural) is not a DependencyProperty.

Read the rest of this entry »