title: putting average of column in footer, I can get the sum
body: <p>I am able to sum an entire column and put the total in a column, but what if i want to get the average of all the numbers in the column?</p>
  
  <pre><code>    Dim paxaverage As Decimal = 0.0
          Function GetAverage(ByVal hope As Decimal) As Decimal
  'this is where i am stuck
              paxaverage += hope / saods.Tables("salesasoftable")Rows.Count
              Return hope
          End Function
          Function Getaverage1() As Decimal
              Return paxaverage
          End Function
  </code></pre>
  
  <p>Asp side</p>
  
  <pre><code>&lt;asp:TemplateField HeaderText="Remaining PAX"&gt;
  &lt;ItemTemplate&gt;
   &lt;%#GetAverage(Decimal.Parse(Eval("RemainingPax").ToString())).ToString("N0")%&gt;
  &lt;/ItemTemplate&gt;
  &lt;FooterTemplate&gt;
  &lt;%#GetAverage1().ToString("N0")%&gt;
  &lt;/FooterTemplate&gt;
      &lt;FooterStyle Font-Bold="True" /&gt;
  &lt;/asp:TemplateField&gt;           
  </code></pre>