Our UX team does not like the flag for processing booleans - they need asp: DropDownList with two parameters for true / false.
My bool should be linked using <% # Bind ("")%>, as shown in the asp: GridView editing template.
Here is my code:
<asp:GridView ...>
...
<Columns>
...
<asp:TemplateField ...>
...
<EditItemTemplate>
<asp:DropDownList ID="ExcludedDropDown" runat="server" SelectedValue='<%# Bind("IsExcluded") %>'>
<asp:ListItem Value="false" Text="Include" meta:resourcekey="ListItemResource0"></asp:ListItem>
<asp:ListItem Value="true" Text="Exclude" meta:resourcekey="ListItemResource1"></asp:ListItem>
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
...
</Columns>
</asp:GridView>
With a breakpoint inside EditItemTemplate, I tried the following in the nearest window:
Eval("Exclude")
false
Where "false" will be the result of Eval. For a good assessment, I tried to change the value of my "true" element to "Truth", "T", "T", "U", "U", "-1", "0", 1 "," "And all of them give the same exception:
"DropDownList" , , .
OnDataBinding, (, ).
, bool / ( ).
bool DropDownList - , ASP.NET? DropDownList.