title: Razor syntax for @Html.CheckBoxFor
body: <p>I'm using Visual studio 2013 with C#.  I have a simple web page that I want to display radio buttons for a section named Urgency.</p>
  
  <p>The values for this Urgency section are sat in a table named urgency in SQL. I can successfully display these values from the database in the form of the @Html.DropDownListFor.  </p>
  
  <p>This is the code I have used for the @Html.DropdownList that works:</p>
  
  <pre><code> @Html.DropDownListFor(model =&gt; model.client.Urgency, new SelectList(Model.allUrgencies, "Id", "Urgency", 0), " - Select Urgency -") 
  </code></pre>
  
  <p>I'm trying to convert the @Html.DropDownListFor to a @Html.CheckBoxFor, this is proving to be very difficult and I'm struggling to get this to work.</p>
  
  <p>I have managed to transform the dropdownlist to the following code but this still produces errors.</p>
  
  <pre><code>@Html.CheckBoxFor(model =&gt; model.client.Urgency, new SelectList(Model.allU, "Id", "Urgency1"))
  </code></pre>
  
  <p>These are the errors:</p>
  
  <blockquote>
    <p>Cannot implicitly convert type 'short?' to 'bool' </p>
    
    <p>Cannot convert lambda expression to delegate type 'System.Func' because some of the return types in the block are not implicitly convertible to the delegate return type.  </p>
  </blockquote>
  
  <p>Here is my list in my Model.</p>
  
  <pre><code> [Display(Name = "Urgency:")]
   public List&lt;Urgency&gt; allUrgencies { get; set; }
  </code></pre>
  
  <p>Here is a screen shot of my database table.</p>
  
  <p><a href="https://i.stack.imgur.com/stRio.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/stRio.png" alt="database screen shot"></a></p>
  
  <p>Any suggestions are welcome. </p>