title: can't access Textbox value which is in gridview control on button click
body: <p>I have taken 3 text-boxes in grid view. I want to access all the 3 text-boxes value in single label on button click event.
  ASP code:</p>
  
  <pre><code>&lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4"
          CssClass="style1" ForeColor="#333333" GridLines="None" Height="342px" Width="548px"&gt;
          &lt;AlternatingRowStyle BackColor="White" ForeColor="#284775" /&gt;
          &lt;Columns&gt;
              &lt;asp:BoundField ApplyFormatInEditMode="True" DataField="IName" HeaderText="Item Name" /&gt;
              &lt;asp:BoundField DataField="Description" HeaderText="Description" /&gt;
              &lt;asp:BoundField DataField="price" HeaderText="Price" /&gt;
              &lt;asp:TemplateField&gt;
                  &lt;HeaderTemplate&gt;
                      &lt;asp:Label ID="txtqty" runat="server" AutoPostBack="false" Text="Enter Quantity" /&gt;
                  &lt;/HeaderTemplate&gt;
                  &lt;ItemTemplate&gt;
                      &lt;asp:TextBox ID="txtqtys" runat="server" AutoPostBack="false" OnTextChanged="TextBox_Changed"/&gt;
                  &lt;/ItemTemplate&gt;
              &lt;/asp:TemplateField&gt;
              &lt;asp:TemplateField&gt;
                  &lt;HeaderTemplate&gt;
                      &lt;asp:Label ID="chkAll" runat="server" onclick="checkAll(this);" AutoPostBack="true"
                          OnCheckedChanged="CheckBox_CheckChanged" Text="Select" /&gt;
                  &lt;/HeaderTemplate&gt;
                  &lt;ItemTemplate&gt;
                      &lt;asp:CheckBox ID="chk" runat="server" onclick="Check_Click(this)" AutoPostBack="True"
                          OnCheckedChanged="CheckBox_CheckChanged" /&gt;
                  &lt;/ItemTemplate&gt;
              &lt;/asp:TemplateField&gt;
          &lt;/Columns&gt;
          &lt;EditRowStyle BackColor="#999999" /&gt;
          &lt;FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /&gt;
          &lt;HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /&gt;
          &lt;PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" /&gt;
          &lt;RowStyle BackColor="#F7F6F3" ForeColor="#333333" /&gt;
          &lt;SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" /&gt;
          &lt;SortedAscendingCellStyle BackColor="#E9E7E2" /&gt;
          &lt;SortedAscendingHeaderStyle BackColor="#506C8C" /&gt;
          &lt;SortedDescendingCellStyle BackColor="#FFFDF8" /&gt;
          &lt;SortedDescendingHeaderStyle BackColor="#6F8DAE" /&gt;
      &lt;/asp:GridView&gt;
  &lt;asp:Label ID="lbltxtqty" runat="server" Text="txtqty" Visible="true"&gt;&lt;/asp:Label&gt;
  &lt;asp:Button ID="btnsubmit" runat="server" Text="Submit" onclick="btnsubmit_Click" /&gt;
  </code></pre>
  
  <p>C# code:</p>
  
  <pre><code>protected void btnsubmit_Click(object sender, EventArgs e)
  {
       if (!IsPostBack)
          {
              lbltxtqty.Visible = true;
              lbltxtqty.Text = ((TextBox)GridView1.Rows[0].FindControl("txtqtys")).Text;
          }
  }
  </code></pre>
  
  <p>so please tell me the write code for it.</p>