Just Code‎ > ‎

Silverlight - Bind to SelectedItems of a DataGrid

posted May 27, 2010, 1:16 AM by Peter Henell   [ updated Aug 14, 2011, 1:28 PM ]
Source http://blogs.msdn.com/b/keithjones/archive/2009/10/02/multiple-selection-in-a-datagrid-should-be-bindable.aspx

<data:DataGrid AutoGenerateColumns="False" Grid.Row="3" Grid.Column="1" IsReadOnly="True"

                     x:Name="MerchantDataGrid"

                     ItemsSource="{Binding MerchantList, Source={StaticResource vmMerchants}}"

                     SelectedItem="{Binding CurrentMerchant, Mode=TwoWay, Source={StaticResource vmMerchants}}"

                     SelectionMode="Extended"

                     helpers:DataGridMultipleSelection.SelectedItemsSource="{Binding Path=AllSelectedMerchants, Source={StaticResource vmMerchants}}"   

                     Background="{Binding DataGridColor, Source={StaticResource vmMerchants}}"      

                      >

                <data:DataGrid.Columns>




ċ
DataGridMultipleSelection.cs
(13k)
Peter Henell,
May 27, 2010, 1:34 AM
Comments