title: bind value to a Textbox in Gridview  header
body: <p>I am using a gridview in aspx page.  I am adding Textboxes dynamically to the griview header. How can I insert a value to the textbox in the grid header.
  My code goes like</p>
  
  <pre><code>protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
  {
      if (e.Row.RowType == DataControlRowType.Header)
      {
      TextBox txtBox1 = default(TextBox);
      for (int i = 0; i &lt;= (e.Row.Cells.Count - 1); i++)
          {
          litHeader.Text = e.Row.Cells[i].Text + "&lt;br/&gt;";
          e.Row.Cells[i].Controls.Add(litHeader);                                   
          e.Row.Cells[i].Controls.Add(txtBox1); 
      }
      }
  } 
  </code></pre>
  
  <p>I am trying to bind a value to the textbox 'txtBox1' using the code</p>
  
  <pre><code>private void FillGridView()
   {
      TextBox txt;
      txt = (TextBox)GridView1.HeaderRow.FindControl("txtBox1");
      txt.Text = dtValues.Rows[0][5].ToString();
   }
  </code></pre>
  
  <p>But I am not able to fill the textbox. Please help.</p>