title: How do I add FooterTemplate to GridView with BoundFields
body: <p>Hope you have a good weekend.
  At long last I have got some editing/delete eventer to work with LINQ support.
  I have an Add record event which I know is working, but after trying a part, I do not know how I am adding some textbox's in my footer. </p>
  
  <p>So it is a row from header and down to footer, without the move to the right or the left.
  Can some help me !? </p>
  
  <p><img src="https://i.stack.imgur.com/RsjQT.png" alt="enter image description here"></p>
  
  <p>My code is</p>
  
  <pre><code>    &lt;asp:GridView ID="gdview"  runat="server" AutoGenerateColumns="False" DataKeyNames="test_id" OnRowCancelingEdit="gdview_RowCancelingEdit" OnRowDeleting="gdview_RowDeleting" OnRowEditing="gdview_RowEditing" OnRowUpdating="gdview_RowUpdating"
          BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black" GridLines="Horizontal" ShowFooter="true"&gt;
          &lt;Columns&gt;
          &lt;asp:BoundField HeaderText="Test CAT" DataField="test_cat"&gt;
              &lt;ItemStyle Height="20px" Width="150px" /&gt;
          &lt;/asp:BoundField&gt;
          &lt;asp:BoundField HeaderText="Test INFO" DataField="test_info"&gt;
              &lt;ItemStyle Height="20px" Width="150px" /&gt;
          &lt;/asp:BoundField&gt;  
          &lt;asp:BoundField HeaderText="Test NUMBER" DataField="test_number"&gt;
              &lt;ItemStyle Height="20px" Width="150px" /&gt;
          &lt;/asp:BoundField&gt;   
          &lt;asp:BoundField HeaderText="Test DATE" DataField="test_datetime"&gt;
              &lt;ItemStyle Height="20px" Width="150px" /&gt;
          &lt;/asp:BoundField&gt;       
          &lt;asp:CommandField ShowEditButton="True"&gt;
              &lt;ItemStyle Width="100px" /&gt;
          &lt;/asp:CommandField&gt;
          &lt;asp:TemplateField&gt;
          &lt;ItemTemplate&gt;
            &lt;asp:LinkButton ID="lnkdel" runat="server" Text="Delete" CommandName="Delete"   OnClientClick="return confirm('Do you want to delete?')"&gt;&lt;/asp:LinkButton&gt;      
          &lt;/ItemTemplate&gt;
          &lt;ItemStyle Width="100px" /&gt;
          &lt;/asp:TemplateField&gt;
  
      &lt;/Columns&gt;
      &lt;FooterStyle BackColor="#CCCC99" ForeColor="Black" /&gt;
      &lt;HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" /&gt;
      &lt;PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" /&gt;
      &lt;SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" /&gt;
      &lt;SortedAscendingCellStyle BackColor="#F7F7F7" /&gt;
      &lt;SortedAscendingHeaderStyle BackColor="#4B4B4B" /&gt;
      &lt;SortedDescendingCellStyle BackColor="#E5E5E5" /&gt;
      &lt;SortedDescendingHeaderStyle BackColor="#242121" /&gt;
      &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>Ok but how with this then work, if i use templates, how do it know what cell to get values from !??</p>
  
  <pre><code> Protected Sub gdview_RowUpdating(ByVal sender As Object, ByVal e As GridViewUpdateEventArgs)
      Using db As New ThedatabaseconnectionDataContext()
          Try
              'getting table
              Dim tbltest As Table(Of testtable) = db.GetTable(Of testtable)()
              'getting an exiting row
              Dim objtest As testtable = tbltest.SingleOrDefault(Function(p) p.test_id = Integer.Parse(gdview.DataKeys(e.RowIndex).Value.ToString()))
              If objtest IsNot Nothing Then
                  'modifying the row
                  objtest.test_cat = DirectCast(gdview.Rows(e.RowIndex).Cells(0).Controls(0), TextBox).Text
                  objtest.test_info = DirectCast(gdview.Rows(e.RowIndex).Cells(1).Controls(0), TextBox).Text
                  objtest.test_number = DirectCast(gdview.Rows(e.RowIndex).Cells(2).Controls(0), TextBox).Text
                  objtest.test_datetime = DirectCast(gdview.Rows(e.RowIndex).Cells(3).Controls(0), TextBox).Text
                  'saving rows added
                  db.SubmitChanges()
                  gdview.EditIndex = -1
                  bindgrid()
                  ' Me.lblMsg.Text = "Updated Successfully"
              Else
                  'Me.lblMsg.Text = "Employee not found"
              End If
          Catch ex As Exception
              'Me.lblMsg.Text = ex.Message
          End Try
      End Using
  </code></pre>