title: How to hide columns in an ASP.NET GridView with auto-generated columns?
body: <p>GridView1.Columns.Count is always zero even SqlDataSource1.DataBind();</p>
  
  <p>But Grid is ok</p>
  
  <p>I can do</p>
  
  <pre><code>for (int i = 0; i &lt; GridView1.HeaderRow.Cells.Count;i++)
  </code></pre>
  
  <p>I rename request headers here
  but</p>
  
  <pre><code>GridView1.Columns[i].Visible = false;
  </code></pre>
  
  <p>I can't use it because of GridView1.Columns.Count is 0.</p>
  
  <p>So how can I hide them ?</p>