title: Binding asp:DropDownList SelectedValue to a Boolean doesn't work - any workarounds?
body: <p>Our UX team doesn't like the checkbox for handling a boolean - they want a asp:DropDownList with two options for true/false.</p>
  
  <p>My bool has to be bound using &lt;%# Bind("") %>, as it's in the edit template of a asp:GridView.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;asp:GridView ...&gt;
      ...
      &lt;Columns&gt;
          ...
          &lt;asp:TemplateField ...&gt;
              ...
              &lt;EditItemTemplate&gt;
                  &lt;asp:DropDownList ID="ExcludedDropDown" runat="server" SelectedValue='&lt;%# Bind("IsExcluded") %&gt;'&gt;
                      &lt;asp:ListItem Value="false" Text="Include" meta:resourcekey="ListItemResource0"&gt;&lt;/asp:ListItem&gt;
                      &lt;asp:ListItem Value="true" Text="Exclude" meta:resourcekey="ListItemResource1"&gt;&lt;/asp:ListItem&gt;
                  &lt;/asp:DropDownList&gt;
              &lt;/EditItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
          ...
      &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>With a breakpoint inside the EditItemTemplate, I tried following in the immediate window:</p>
  
  <pre><code>Eval("Exclude")
  false
  </code></pre>
  
  <p>Where "false" would be the result of the Eval. Just for good measure, I did try to change the value of my "true" item to: "True", "T", "t", "Y", "y", "-1","0", "1", ""
  And all yield the same exception:</p>
  
  <blockquote>
    <p>'DropDownList' has a selectedvalue which is invalid because it does not exist in the list of items.</p>
  </blockquote>
  
  <p>I tried to work around using the "OnDataBinding" event, but this didn't help me at all (maybe I just did it wrong).</p>
  
  <p>I prefer not to add a property to our Class that converts the bool into a string/integer (as that would work right away).</p>
  
  <p>Is it impossible to bind a bool to DropDownList - and if it is, why would it make sense to have this restriction in ASP.NET? Have a hard time seeing the difference between supporting integers and boolean in DropDownList.</p>