title: add control in first row of each column in grid view
body: <p>I wan to add a simple link button in <code>gridview's</code> first row in all columns . I have written code on <code>rowdatabound</code> event </p>
  
  <p>my code is as follow </p>
  
  <pre><code>protected void grdCompareProducts_RowDataBound(object sender, GridViewRowEventArgs e)
      {
          if (e.Row.RowType == DataControlRowType.DataRow)
          {
  
  
              PlaceHolder col1 = e.Row.FindControl("col1") as PlaceHolder;
              PlaceHolder col2 = e.Row.FindControl("col2") as PlaceHolder;
              PlaceHolder col3 = e.Row.FindControl("col3") as PlaceHolder;
              PlaceHolder col4 = e.Row.FindControl("col4") as PlaceHolder;
  
              LinkButton lnkProductName = new LinkButton();
              lnkProductName.Text = "Product Name";
  
  
  
  
              if (e.Row.RowIndex == 0)
              {
                  if (col1 != null)
                  {
  
                      col1.Controls.Add(lnkProductName);
                      col2.Controls.Add(lnkProductName);
                      col3.Controls.Add(lnkProductName);
                      col4.Controls.Add(lnkProductName);
                  }
              }
  
          }
      }
  </code></pre>
  
  <p>but its showing  link button only in last column . HTML for  grid view as follow ..</p>
  
  <pre><code>&lt;asp:GridView ID="grdCompareProducts" runat="server" AutoGenerateColumns="false"
              ShowHeader="false" CssClass="compare-info" Width="100%" CellPadding="6" CellSpacing="0"
              OnRowCommand="grdCompareProducts_RowCommand" OnRowDataBound="grdCompareProducts_RowDataBound"&gt;
              &lt;Columns&gt;
                  &lt;asp:TemplateField&gt;
                      &lt;ItemTemplate&gt;
                          &lt;asp:Label ID="lblHeader" runat="server" Text='&lt;%#Eval("header") %&gt;' CssClass="header_strong"&gt;&lt;/asp:Label&gt;
                      &lt;/ItemTemplate&gt;
                  &lt;/asp:TemplateField&gt;
                  &lt;asp:TemplateField&gt;
                      &lt;ItemTemplate&gt;
                          &lt;asp:PlaceHolder ID="col1" runat="server"&gt;&lt;/asp:PlaceHolder&gt;
                      &lt;/ItemTemplate&gt;
                  &lt;/asp:TemplateField&gt;
                  &lt;asp:TemplateField&gt;
                      &lt;ItemTemplate&gt;
                          &lt;asp:PlaceHolder ID="col2" runat="server"&gt;&lt;/asp:PlaceHolder&gt;
                      &lt;/ItemTemplate&gt;
                  &lt;/asp:TemplateField&gt;
                  &lt;asp:TemplateField&gt;
                      &lt;ItemTemplate&gt;
                          &lt;asp:PlaceHolder ID="col3" runat="server"&gt;&lt;/asp:PlaceHolder&gt;
                      &lt;/ItemTemplate&gt;
                  &lt;/asp:TemplateField&gt;
                  &lt;asp:TemplateField&gt;
                      &lt;ItemTemplate&gt;
                          &lt;asp:PlaceHolder ID="col4" runat="server"&gt;&lt;/asp:PlaceHolder&gt;
                      &lt;/ItemTemplate&gt;
                  &lt;/asp:TemplateField&gt;
              &lt;/Columns&gt;
          &lt;/asp:GridView&gt;
  </code></pre>