title: Multiple footer rows in gridview
body: <p>How can i display information in multiple rows in grid-view footer using code behind</p>
  
  <p>for example</p>
  
  <pre><code>header1   header2           header3
  
   data        data              data
  
   data        data              data
  
               Amount:           value
  
               Shipping Cost:    value
  
               Total Amount:     value
  </code></pre>
  
  <p>How can i add Shipping cost and Total Amount in the footer</p>
  
  <pre><code>protected void gridinvoice_RowDataBound(object sender, GridViewRowEventArgs e)
  {
      decimal Amount = 0;
  
      for (int y = 0; y &lt; gridinvoice.Rows.Count; y++)
      {
          Amount += Convert.ToDecimal(gridinvoice.Rows[y].Cells[4].Text);
      }
  
      if (e.Row.RowType == DataControlRowType.Footer)
      {  
          e.Row.Cells[3].Text = "Amount";
          e.Row.Cells[4].Text = Amount.ToString();
      }
  
  }
  </code></pre>