title: Understanding WebGrid in C#
body: <p>I am trying to get to grips with WebGrid in a c# MVC4 project. The following code gives this error...</p>
  
  <blockquote>
    <p>Compiler Error Message: CS1502: The best overloaded method match for
    'System.Web.Helpers.WebGrid.WebGrid(System.Collections.Generic.IEnumerable,
    System.Collections.Generic.IEnumerable, string, int, bool,
    bool, string, string, string, string, string, string, string)' has
    some invalid arguments</p>
  </blockquote>
  
  <pre><code>@{
      Layout = null;
  }
  
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta name="viewport" content="width=device-width" /&gt;
  
      @{
          List&lt;int&gt; obj1 = new List&lt;int&gt;(){ 1, 2, 3, 4 };
          var obj1_i = (IEnumerable&lt;int&gt;)obj1;       
          var grid = new WebGrid(obj1_i);
      }
  
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div&gt;
          @grid.GetHtml()
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>