title: Model binding for a custom EditorTemplate
body: <p>I am trying to provide a radio button list to choose an option from a small set of strings within an MVC 3 model. I am working on is the editor template for question within a survey.</p>
  
  <p>So far I have followed <a href="https://stackoverflow.com/a/9493584/37436">Brad Christie's advice</a>, which has allowed me to render the view properly. Here's the relevant code:</p>
  
  <p><strong>Model - Question.cs</strong></p>
  
  <p><em>(Note, this is actually a model-first EF entity, but I don't believe it matters)</em></p>
  
  <pre><code>public class Question {
      // snip unimportant properties
      public string QuestionType { get; set; }
  }
  </code></pre>
  
  <p><strong>View - Question.cshtml</strong></p>
  
  <pre><code>// snip unimportant view code
  
  &lt;div class="control-group"&gt;
      @Html.LabelFor(model =&gt; model.QuestionType, "Question Type")
      &lt;div class="controls"&gt;
          @Html.EditorFor(model =&gt; model.QuestionType, "QuestionType")
          @Html.ValidationMessageFor(model =&gt; model.QuestionType)
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>View - QuestionType.cshtml</strong></p>
  
  <pre><code>@model System.String
  
  @{
      var questionTypes = new String[] { "PickOne", "PickMany", "OpenEnded" };
      var typesMap = new Dictionary&lt;String, String&gt; {
          { "PickOne", "Pick a single answer" },
          { "PickMany", "Pick several answers" },
          { "OpenEnded", "Open-ended answer" }
      };
  }
  
  @foreach (var questionType in questionTypes) {
      &lt;label class="radio"&gt;
          @Html.RadioButtonFor(model =&gt; model, questionType)
          @typesMap[questionType]
      &lt;/label&gt;
  }
  </code></pre>
  
  <p>Though the view creates the correct HTML, when I load up the editor view for a survey, the radio button corresponding to its question type is not pre-selected upon page load. I'm assuming this has to do with model binding?</p>
  
  <p>How can I pre-select the correct radio button based on the choice that exists in the database? In case it's important, I am using model-first Entity Framework 4 as my persistence layer.</p>