title: MVC4 .Net How to place DropDown in WebGrid Cell
body: <p>I have seen a number of questions that are similar to this one, but I have not come across one with an answer that works for me.  Yet :)</p>
  
  <p>My Model looks like this:</p>
  
  <pre><code>public class MyModel
  {
      public List&lt;MyItem&gt; MyItems{get;set;}
      public List&lt;SelectListItem&gt; MySet{get;set;}
  }
  </code></pre>
  
  <p>MyItem looks like this:</p>
  
  <pre><code>public class MyItem
  {
      public int MyItemId
  }
  </code></pre>
  
  <p>My view has <code>@model MyModel</code> at the top.</p>
  
  <p>My WebGrid looks like this:</p>
  
  <pre><code>@{
      var grid = new WebGrid( Model.MyItems, canPage: false );
          var gridColumns = new List&lt;WebGridColumn&gt;
          {
              grid.Column( 
                  format: (item) =&gt; @Html.DropDownListFor(modelItem =&gt; item.MyItemId.ToString(), Model.MySet ) )
          };
          @grid.GetHtml( "wgtable",
              rowStyle: "gridrow",
              alternatingRowStyle: "altgridrow",
              displayHeader: true,
              columns: grid.Columns( gridColumns.ToArray( ) ) )
      }
  </code></pre>
  
  <p>In this case, the error I get is CS1963:  An expression tree may not contain a dynamic operation.</p>
  
  <p>I have also tried </p>
  
  <pre><code>format: (item) =&gt; @Html.DropDownListFor(item.MyItemId.ToString(), Model.SubPayGroups ) )
  </code></pre>
  
  <p>which gives me CS1973: Model has no applicable method named 'DropDownListFor'.</p>
  
  <p>Am I even close?</p>