title: ASP.NET MVC3 WebGrid format: parameter
body: <p>I am trying to use the new WebGrid in ASP.NET MVC3 and one of the columns I want to display set of link icons that performs various actions (Edit, View, Delete)...
  For this purpose I have a HtmlHelper extensions that basically outputs following HTML:</p>
  
  <pre><code>&lt;a href="" title=""&gt;&lt;img alt="" src="" /&gt;&lt;/a&gt;
  </code></pre>
  
  <p>The extension returns MvcHtmlString and it works fine when used in Razor views by itself..Eg:
  @Html.ActionLinkIconForEditAction("Customer", 2)</p>
  
  <p>The issue is I need to invoke this helper (once for each action) in WebGrid column while passing the ID of the object. The problem that I am stumped on is that compiler gives me an error saying that it cannot convert MvcHtmlString (or 'lambda expression' depending on invocation I try) to System.Func expected by the format...</p>
  
  <p>So for example, this works:</p>
  
  <pre><code>grid.Column(header: "", format: @&lt;text&gt;@Html.ActionLinkIconForEditAction("Customer", 2)&lt;/text&gt;)
  </code></pre>
  
  <p>But this does not:</p>
  
  <pre><code>grid.Column(header: "", format: (customer) =&gt; @&lt;text&gt;@Html.ActionLinkIconForEditAction("Customer", customer.Id)&lt;/text&gt;)
  grid.Column(header: "", format: (customer) =&gt; Html.ActionLinkIconForEditAction("Customer", customer.Id))
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>Error 4 Argument 3: cannot convert from 'lambda expression' to 'System.Func&lt;dynamic,object&gt;'
  </code></pre>
  
  <p>or for this call:</p>
  
  <pre><code>grid.Column(header: "", format: Html.ActionLinkIconForEditAction("Customer", customer.Id)),
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>Error 5 Argument 3: cannot convert from 'System.Web.Mvc.MvcHtmlString' to 'System.Func&lt;dynamic,object&gt;'
  </code></pre>
  
  <p>What is weird I have other columns that ustilize lambdas, direct Model.Property accessors, and even output from String.Format("")...They all work fine...
  I read all the docs on Func and <a href="https://stackoverflow.com/questions/1213527/how-does-funct-tresult-work">this thread as well</a>, and still can't quite figure it out :)</p>
  
  <p>Can anyone spot what I am doing wrong?</p>