title: Webview giving Column Does not Exist Error
body: <p>I am using </p>
  
  <ul>
  <li>MVC 3</li>
  <li>VB.NET and</li>
  <li>Razor ViewEngine. </li>
  </ul>
  
  <p>I am playing around with <code>WebGrid</code> in my application and it is telling me "failEmList" does not exist.</p>
  
  <p>Below is the code from the calling Function, the View, and the part of the model that it is getting the data from.</p>
  
  <p>FailEmailSends is just a List(of string) and has lines with single entries of email Addresses.</p>
  
  <pre><code>  Dim vm As New MassEmailVM
    For Each _fail In failEmailSends
        vm.failEmList.Add(_fail)
    Next
    ViewBag.succCount = succCount.ToString
    ViewBag.failECount = failEmailCount.ToString
    Return View(vm)
  </code></pre>
  
  <p>View is as follows:</p>
  
  <pre><code>@Modeltype xxxxxxxxxxxxx
  @Code
  ViewData("Title") = "Mass Emails Sent"
  
  End Code
  
  
  &lt;table&gt;
  &lt;tr&gt;&lt;th&gt;Total Sent&lt;/th&gt;&lt;td&gt;@ViewBag.succCount&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;th&gt;Total Fail&lt;/th&gt;&lt;td&gt;@ViewBag.failECount&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;th&gt;Fail Email Addresses&lt;/th&gt;&lt;/tr&gt;
  &lt;/table&gt;
  
  @code
  Dim grid = New WebGrid(Model.failEmList)
  
  End Code
  
  
  &lt;div id="grid"&gt;
  @grid.GetHtml(
  tableStyle:="grid",
  headerStyle:="head",
  alternatingRowStyle:="alt",
  columns:=grid.Columns(
      grid.Column("failEmList", "Email List")
      ))
  &lt;/div&gt;
  </code></pre>
  
  <p>Relevant part of view Model:</p>
  
  <pre><code>Private _failEmList As New List(Of String)
  Public Property failEmList() As List(Of String)
      Get
          Return _failEmList
      End Get
      Set(ByVal value As List(Of String))
          _failEmList = value
      End Set
  End Property
  </code></pre>
  
  <p>Any ideas why this is throwing the following error:</p>
  
  <pre><code>  System.InvalidOperationException was unhandled by user code
    Message=Column "failEmList" does not exist.
    Source=System.Web.Helpers
    StackTrace:
     at System.Web.Helpers.WebGridRow.get_Item(String name)
     at System.Web.Helpers.WebGrid.GetTableBodyHtml(IEnumerable`1 columns, String rowStyle, String alternatingRowStyle, String selectedRowStyle)
     at System.Web.Helpers.WebGrid.Table(String tableStyle, String headerStyle, String footerStyle, String rowStyle, String alternatingRowStyle, String selectedRowStyle, String caption, Boolean displayHeader, Boolean fillEmptyRows, String emptyRowCellValue, IEnumerable`1 columns, IEnumerable`1 exclusions, Func`2 footer, Object htmlAttributes)
     at System.Web.Helpers.WebGrid.GetHtml(String tableStyle, String headerStyle, String footerStyle, String rowStyle, String alternatingRowStyle, String selectedRowStyle, String caption, Boolean displayHeader, Boolean fillEmptyRows, String emptyRowCellValue, IEnumerable`1 columns, IEnumerable`1 exclusions, WebGridPagerModes mode, String firstText, String previousText, String nextText, String lastText, Int32 numericLinksCount, Object htmlAttributes)
     at ASP._Page_Views_Admin_MassEmailsSent_vbhtml.Execute() in C:\Users\Skindeep\Documents\Visual Studio 2010\Projects\xxxxxxxxxx\Views\Admin\MassEmailsSent.vbhtml:line 21
     at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
     at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
     at System.Web.WebPages.StartPage.RunPage()
     at System.Web.WebPages.StartPage.ExecutePageHierarchy()
     at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
     at System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance)
     at System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer)
     at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
     at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult)
     at System.Web.Mvc.ControllerActionInvoker.&lt;&gt;c__DisplayClass1c.&lt;InvokeActionResultWithFilters&gt;b__19()
     at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)
     InnerException: 
  </code></pre>