Have to use free WPF DataGrid (I thought Infragistics libraries are bad, I take it back after this) for this project of mine.
Looks like DataGrid doesnt have clean MVVM Friendly way of getting the list of selectedRows ?
I can data bind to SelectedItem="{Binding SelectedSourceFile}" but this only shows the 1st selected row. Need to be able to get all selected rows.
Any hints to do it cleanly via MVVM ?
You could use a workaround I created for situations like this that allows you to do
OneWayToSourceBindings for readonly dependency properties. I call itPushBinding.I made a blog post about it here: OneWayToSource Binding for ReadOnly Dependency Property
To bind
SelectedItems, you can do thisAnd the property in the ViewModel
If you’re interested, you can download a demo project using
PushBindinghere: PushBindingInStyleDemo.zip