title: C# WPF XamDataGrid How to get Total of a Field and put it into textbox
body: <p>How can i get the total of a field in a XamDataGrid?  I want to show the sum of all records' $ amounts in a textbox NOT in the grid itself.  Here's how i did this for the number of items in the grid, which works:</p>
  
  <pre><code>&lt;Label Content="Total Line Items"/&gt;
              &lt;TextBox Text="{Binding ElementName=xamDataGrid1, Path=Records.Count, Mode=OneWay}" Grid.Column="1" /&gt;
  </code></pre>
  
  <p>So how can i sum a certain field?  Is it possible to do anything like:</p>
  
  <pre><code>        &lt;Label Content="Total Salaries: " Grid.Column="2" /&gt;
          &lt;TextBox Grid.Column="3" BorderBrush="Red" Text="{Binding ElementName=xamDataGrid1, Path=**SUM(SALARYFIELD)**, Mode=OneWay}"/&gt;
  </code></pre>
  
  <p>I do not want the SummaryDefintions method (I know how to do that already) and i must not refer to the grid in code-behind etc.  What can i put in the binding, or what can i replace SUM(SALARYFIELD) with to make this work?</p>