title: How to find label ID(ItemTemplate) and textbox ID(EditItemTemplate) in gridview?
body: <p>I need some help.</p>
  
  <p>In my gridview (binded to a SQLDataSource), there is a label (lblDI) in the item template and textbox(tbEditDI) in the edit item template</p>
  
  <pre><code> &lt;asp:GridView ID="gvDiscussItem" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="Black" BorderStyle="Double" BorderWidth="1px" 
  CellPadding="2" DataKeyNames="discussionID" DataSourceID="SQLDiscussItems" 
  ForeColor="Black" ShowHeaderWhenEmpty="True" 
  style="font-size: small" Width="600px" &gt;
  &lt;Columns&gt;
  &lt;ItemTemplate&gt;
  &lt;asp:Label ID="lblDI" runat="server" Text='&lt;%# Bind("discussionItem") %&gt;'&gt;&lt;/asp:Label&gt;
  &lt;/ItemTemplate&gt;
  &lt;EditItemTemplate&gt;
  &lt;asp:TextBox ID="tbEditDI" runat="server" Text='&lt;%# Bind("discussionItem") %&gt;' 
  TextMode="MultiLine" onkeyup="SettingEditHeightDI(this);"&gt;&lt;/asp:TextBox&gt;
  &lt;/EditItemTemplate&gt;
  &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>How can i make the label(lblDI) to become multiline to display data, and the textbox(tbEditDI) to fit all the texts on page load?</p>
  
  <p>I have these codes which I can use for reference help me to make the label multiline, and the textbox to fit to size on pageload, but it is not working now, as for the label, I'm unable to get the control of the label to be used in the aspx.cs page, and the control of the textbox to auto resize on load through javascript.</p>
  
  <pre><code>// to auto resize the textbox on pageload automatically using javascript
    document.getElementById("&lt;%=tbAgenda.ClientID%&gt;").style.height = document.getElementById("&lt;%=tbAgenda.ClientID%&gt;").scrollHeight + "px";
  </code></pre>
  
  <p>and </p>
  
  <pre><code>// to display multiline label in the aspx.cs page
   lblAgenda.Text = recentMinute.Agenda.Replace("\n", "&lt;br/&gt;"); // displays multilines textbox texts in a multiline label. For retrieval from database
  </code></pre>
  
  <p>Please help me, I'm having great trouble in this academic project. :'(</p>