title: GridView Header Text in asp.net
body: <p>I want to change the header text of the gridview using Design from <code>&lt;TemplateField HeaderText=&quot;&quot;&gt;</code>.</p>
  <p>I created a variable in code behind which is public and set the value in that variable and then I tried to call that variable over here as below:</p>
  <pre><code>&lt;TemplateField HeaderText = '&lt;%= VariableCallHere %&gt;'
  </code></pre>
  <p>But while running the page, I got &lt;%= VariableCallHere %&gt; as a header text.</p>
  <p>Even I tried changing using <code>gridView1.HeaderRow.Cells[0].Text = &quot;text Here&quot;</code> (This Throws object reference error)</p>
  <p>Any one have any suggestions how this could be achieved?</p>