A recent problem I had was to bind the SelectedItem from a master datagrid, to the ItemsSource of a child datagrid. My work around’s using mouse clicks had too many limitations when used with MVVM – delete the selected item from the parent collection, the child collection did not update. Whilst watching John Papas PDC... Continue Reading →
Silverlight Commands – Data grid row selected
following on from http://thoughtjelly.blogspot.com/2009/09/silverlight-prism-commands-textchanged.html and in response to John Papa’s PDC talk http://johnpapa.net/silverlight/mvvm-and-prism-demo-for-pdc09-silverlight-session. Another highly useful command behaviour is for DataGridRowSelected. This also gets over the issues described here and here. The code (as written by John Papa) is: public class DataGridRowSelectedCommandBehavior : CommandBehaviorBase{public DataGridRowSelectedCommandBehavior(DataGrid selectableObject): base(selectableObject){selectableObject.SelectionChanged += OnSelectionChanged;}private void OnSelectionChanged(object sender, SelectionChangedEventArgs e){this.CommandParameter =... Continue Reading →