title: How do I do a sum of gridview cells from selected rows in WPF using c#?
body: <p>If I had to do a sum of a specific columns of selected rows in a DataGridView, I would usually do something like</p>
  <pre><code>decimal total = myDGV.SelectedRows.OfType&lt;DataGridViewRow&gt;()
      .Sum(t =&gt; Convert.ToDecimal(t.Cells[2].Value));
  </code></pre>
  <p>How do I do that in WPF?</p>
  <p>If I did:</p>
  <pre><code>decimal total = myGrid.SelectedItems.OfType&lt;DataGridRow&gt;()
      .Sum(t =&gt; Convert.ToDecimal(t.Cells[2].Value));
  </code></pre>
  <p>I get an error <code>'System.Windows.Controls.DataGridRow' does not contain a definition for 'Cells' and no extension method 'Cells' accepting a first argument of type 'System.Windows.Controls.DataGridRow' could be found (are you missing a using directive or an assembly reference?) (CS1061)</code></p>
  <p>Help please.</p>