title: Remove Column using GridView to Export to Excel
body: <p>I am binding a gridView to a <code>List&lt;model&gt;</code>. I am able to export it to an excel file but I am not able to remove a specific column. Any Ideas on how do so? I tried <code>gridView.Columns.RemoveAt(myIndex)</code> but didn't work and threw a null exception and I am assuming this is because the gridView is not binded to a dataTable.</p>
  
  <pre><code>var models = new ModelService().List(startDate, DateTime.Now);
  var gridView = new GridView { DataSource = models };                       
  
  gridView.DataBind();
  </code></pre>