title: Get Values of Multiple Selected Rows in WPF DataGrid
body: <p>I'm trying to get the values of the first column ("Value") of all selected rows in a WPF DataGrid.</p>
  
  <p>Here's the XAML:</p>
  
  <pre><code>        &lt;DataGrid x:Name="UPCs"
                    ItemsSource="{Binding Source={StaticResource SumsViewSource}}"
                    AutoGenerateColumns="False"
                    HeadersVisibility="Column"
                    IsReadOnly="True"&gt;
              &lt;DataGrid.Columns&gt;
                  &lt;DataGridTextColumn x:Name="Value"
                                      Binding="{Binding Value}"
                                      Header="Item"
                                      Width="3*" /&gt;
                  &lt;DataGridTextColumn x:Name="Qty"
                                      Binding="{Binding Qty}"
                                      Header="Qty"
                                      Width="1*" /&gt;
              &lt;/DataGrid.Columns&gt;
          &lt;/DataGrid&gt;
  </code></pre>
  
  <p>I've already figured out how to get the needed value from the first selected row:</p>
  
  <pre><code>Dim SelRow As String = DirectCast(UPCs.Columns.Item(0).GetCellContent(UPCs.SelectedValue), TextBlock).Text
  </code></pre>
  
  <p>I cannot figure out how to adopt this for a multi-row selection.</p>