title: ASP.net GridView - Use If-Statement in HeaderText property of BoundField
body: <p>Can I do something like this:</p>
  
  <pre><code>    &lt;asp:BoundField DataField="Field1" 
  HeaderText='&lt;% IF(Eval("Field2").ToString().SubString(3,4).Equals("Text3"),"Text1","Text2") %&gt;'
  SortExpression="Field1" /&gt;
  </code></pre>
  
  <p>With the goal of having the header of Field1 be Text1 when the 4th-7th characters of Field2 = Text3 and Text2 otherwise?</p>
  
  <p>I tried it and it just put "'&lt;% IF(Eval("Field2").ToString().SubString(3,4).Equals("Text3"),"Text1","Text2") %>'" as the actual header string!</p>
  
  <p>Thanks in advance!</p>