title: How to format automatically generated WebGrid date columns
body: <p>I see there are a lot of answers exaplaining how to format a <code>DateTime</code> <code>WebGrid</code> column individually, but is it possible to set a <code>WebGrid</code> to automtically format all columns of type <code>DateTime</code>?</p>
  
  <p>I ask because my <code>WebGrid</code> automatically pulls the data from my classes, so I never actually access <code>webgrid.Column</code>, due to the fact that I am using (an attempt at) a generic <code>WebGrid</code> view: </p>
  
  <pre><code>@model IEnumerable&lt;MVCQCPage.Helpers.IGriddable&gt;
  
  @{
      var grid = new WebGrid(new List&lt;object&gt;());
      var linkPrefix = string.Empty;
      var selectable = false;
  
      if (Model.Count() &gt; 0)
      {
          string[] columnNames = { };
  
          var firstItem = Model.First();
  
          linkPrefix = firstItem.RowLinkPrefix;
          columnNames = firstItem.ColumnHeaders;
          selectable = firstItem.Selectable;
  
          grid = new WebGrid(Model,
              rowsPerPage: 100,
              columnNames: columnNames);
      }
  }
  &lt;div id="grid"&gt;
      @grid.GetHtml(
              tableStyle: "table",
              alternatingRowStyle: "alternate",
              headerStyle: "header"
          )
  &lt;/div&gt;
  </code></pre>
  
  <p>Where <code>IGriddable</code> looks like this: </p>
  
  <pre><code>public interface IGriddable
  {
      string RowLinkPrefix { get; }
      string[] ColumnHeaders { get; }
      bool Selectable { get; }
  }
  </code></pre>
  
  <p>So that each class that implements it might contain something like this: </p>
  
  <pre><code>public string[] ColumnHeaders { get; } = new string[] { "SampleNo", "QCDate", "StatusClerk", "StatusSupervisor" };
  public string RowLinkPrefix { get { return $"/receiving/{Pallet.Grv.GRVNo}/{Pallet.PalletSeq}/"; } }
  public bool Selectable { get; } = true;
  </code></pre>
  
  <p>I tried adding a <code>Displayformat</code>to the <code>QCDate</code> property, but this does not help. </p>
  
  <p>Any help or advice is much appreciated, thanks!</p>