title: Display gridview cell values to textbox in asp.net
body: <p>I'm working with asp.net nested gridview,in which I need to show the gridview cell values to the textbox for editing.</p>
  
  <p>My problem is that I don't know how to display values to textbox if i ve used both template field &amp; boundfield. Here is my aspx.</p>
  
  <pre><code>    &lt;Columns&gt;
      &lt;asp:TemplateField ItemStyle-Width="10px"&gt;
        &lt;ItemTemplate&gt;
        &lt;img alt = "" style="cursor: pointer" src="images/plus.png"  /&gt;
        &lt;asp:Panel ID="pnsections" runat="server" Style="display: none;"&gt;
        &lt;asp:HiddenField ID="HdnId" runat="server" Value='&lt;%# Eval("Dept_Name") %&gt;' /&gt;
        &lt;asp:GridView ID="gvsections" Width="100%" CssClass="table table-bordered table-hover" runat="server" AutoGenerateColumns="false" OnRowDataBound="gvsections_rowdatabound"  OnRowEditing="gvsections_rowediting"  DataKeyNames="Dept_Name"&gt;
  
        &lt;Columns&gt;
  
        &lt;asp:BoundField ItemStyle-Width="150px" DataField="currdept" HeaderText="Deptcurrent" /&gt;
        &lt;asp:BoundField ItemStyle-Width="150px" DataField="Dept_Name" HeaderText="SectionName" /&gt;
        &lt;asp:BoundField ItemStyle-Width="150px" DataField="FLDTYPE" HeaderText="Type" HeaderStyle-CssClass=" visible-lg visible-md" ItemStyle-CssClass=" visible-lg visible-md " /&gt;
  
        &lt;/Columns&gt;
     &lt;/asp:GridView&gt;
     &lt;/asp:Panel&gt;
     &lt;/ItemTemplate&gt;
   &lt;/asp:TemplateField&gt;
   &lt;asp:BoundField ItemStyle-Width="150px" DataField="Dept_Name" HeaderText="Department" /&gt;
   &lt;asp:BoundField ItemStyle-Width="150px" DataField="FLDTYPE" HeaderText="Type" /&gt;
  
      &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  </code></pre>