title: foreach loop for gridview.row[e.rowindex]
body: <p>I have wired a gridSearchResults_RowUpdating event for everytime an update link button is clicked. What I want to do is loop through the row at the event rowindex and add the textbox value in the row cell to a string collection. I am having troubh accessing the textbox in the cell. If this doesn't make sense my code should help make things clearer.</p>
  
  <p><strong>HTML</strong>
      
          
              </p>
  
  <pre><code>        &lt;asp:TemplateField HeaderText="Title" SortExpression="Title"&gt;
                  &lt;ItemTemplate&gt;
                      &lt;asp:Label ID="lblTitle" runat="server" Text='&lt;%# Eval("jobTitle") %&gt;'&gt;&lt;/asp:Label&gt;
                  &lt;/ItemTemplate&gt;
                  &lt;EditItemTemplate&gt;
                      &lt;asp:TextBox ID="txtTitle" runat="server" Text='&lt;%# Bind("jobTitle") %&gt;' ReadOnly="true"
                          BorderStyle="none" BorderWidth="0px" Width="80"&gt;
                      &lt;/asp:TextBox&gt;
                  &lt;/EditItemTemplate&gt;
              &lt;/asp:TemplateField&gt;
  
              &lt;asp:TemplateField HeaderText="First Name" SortExpression="FirstName"&gt;
                  &lt;ItemTemplate&gt;
                      &lt;asp:Label ID="lblFirstName" runat="server" Text='&lt;%# Eval("FirstName") %&gt;'&gt;&lt;/asp:Label&gt;
                  &lt;/ItemTemplate&gt;
                  &lt;EditItemTemplate&gt;
                      &lt;asp:TextBox ID="txtFirstName" runat="server" Text='&lt;%# Bind("FirstName") %&gt;' ReadOnly="true"
                          BorderStyle="none" BorderWidth="0px" Width="80"&gt;
                      &lt;/asp:TextBox&gt;
                  &lt;/EditItemTemplate&gt;
              &lt;/asp:TemplateField&gt;
  
              &lt;asp:TemplateField HeaderText="Last Name" SortExpression="LastName"&gt;
                  &lt;ItemTemplate&gt;
                      &lt;asp:Label ID="lblLastName" runat="server" Text='&lt;%# Eval("LastName") %&gt;'&gt;&lt;/asp:Label&gt;
                  &lt;/ItemTemplate&gt;
                  &lt;EditItemTemplate&gt;
                      &lt;asp:TextBox ID="txtLastName" runat="server" Text='&lt;%# Bind("LastName") %&gt;' ReadOnly="true"
                          BorderStyle="none" BorderWidth="0px" Width="80"&gt;
                      &lt;/asp:TextBox&gt;
                  &lt;/EditItemTemplate&gt;
              &lt;/asp:TemplateField&gt;
  
               &lt;asp:TemplateField HeaderText="Email Address" SortExpression="EmailAddress"&gt;
                  &lt;ItemTemplate&gt;
                      &lt;asp:Label ID="lblEmailAddress" runat="server" Text='&lt;%# Eval("EmailAddress") %&gt;'&gt;&lt;/asp:Label&gt;
                  &lt;/ItemTemplate&gt;
                  &lt;EditItemTemplate&gt;
                      &lt;asp:TextBox ID="txtEmailAddress" runat="server" Text='&lt;%# Bind("EmailAddress") %&gt;' ReadOnly="true"
                          BorderStyle="none" BorderWidth="0px" Width="80"&gt;
                      &lt;/asp:TextBox&gt;
                  &lt;/EditItemTemplate&gt;
              &lt;/asp:TemplateField&gt;
  
              &lt;asp:TemplateField HeaderText="Telephone Number" SortExpression="TelephoneNumber"&gt;
                  &lt;ItemTemplate&gt;
                      &lt;asp:Label ID="lblTelephoneNumber" runat="server" Text='&lt;%# Eval("TelephoneNumber") %&gt;'&gt;&lt;/asp:Label&gt;
                  &lt;/ItemTemplate&gt;
                  &lt;EditItemTemplate&gt;
                      &lt;asp:TextBox ID="txtTelephoneNumber" runat="server" Text='&lt;%# Bind("TelephoneNumber") %&gt;' ReadOnly="true"
                          BorderStyle="none" BorderWidth="0px" Width="80"&gt;
                      &lt;/asp:TextBox&gt;
                  &lt;/EditItemTemplate&gt;
              &lt;/asp:TemplateField&gt;
  
              &lt;asp:TemplateField HeaderText="Company" SortExpression="Company"&gt;
                  &lt;ItemTemplate&gt;
                      &lt;asp:Label ID="lblCompany" runat="server" Text='&lt;%# Eval("Company") %&gt;'&gt;&lt;/asp:Label&gt;
                  &lt;/ItemTemplate&gt;
                  &lt;EditItemTemplate&gt;
                      &lt;asp:TextBox ID="txtCompany" runat="server" Text='&lt;%# Bind("Company") %&gt;' ReadOnly="true"
                          BorderStyle="none" BorderWidth="0px" Width="80"&gt;
                      &lt;/asp:TextBox&gt;
                  &lt;/EditItemTemplate&gt;
              &lt;/asp:TemplateField&gt;
              &lt;asp:TemplateField&gt;
                  &lt;ItemTemplate&gt;
                      &lt;asp:LinkButton ID="lbEditLink" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit"&gt;&lt;/asp:LinkButton&gt;
                  &lt;/ItemTemplate&gt;
                  &lt;EditItemTemplate&gt;
                  &lt;asp:LinkButton ID="lbCancelLink" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel"&gt;&lt;/asp:LinkButton&gt;
                  &lt;asp:LinkButton ID="lbUpdateLink" runat="server" CausesValidation="False" CommandName="Update" Text="Update"&gt;&lt;/asp:LinkButton&gt;
                  &lt;/EditItemTemplate&gt;
  
              &lt;/asp:TemplateField&gt;
  
          &lt;/Columns&gt;
      &lt;/asp:GridView&gt;
  </code></pre>
  
  <p><strong>C#</strong></p>
  
  <pre><code>protected void gridSearchResults_RowUpdating(object sender, GridViewUpdateEventArgs e)
  {
          GridViewRow row = gridSearchResults.Rows[e.RowIndex];
  
          foreach (gridviewrow c in gridSearchResults.Rows[e.RowIndex])
          {
  
          }
  }
  </code></pre>
  
  <p>So does anyone know a good way of looping through the cells of a gridview row and grabbing the textbox value in the gridview row cell. Thanks</p>